Return structuredContent with an outputSchema from status tools

Offen
#156 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
60/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
docker, node.js, typescript
Bereich
api, tooling

Rechercherichtung

Open mcp-server/src/tools/serviceHealth.ts first — the zod docker-ps schema already exists and is flattened to text around lines 206-233; compare with healthCheck.ts:95-110 and the forNodes helper in mcp-server/src/utils/fan-out.ts:18, which only returns text. Read CLAUDE.md and CONTRIBUTING.md for the registerTool convention, then declare outputSchema per tool and return structuredContent alongside the unchanged text. Run cd mcp-server && npm install && npm test plus npm run typecheck; done means the listed tools validate structured results while text output stays byte-identical.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement severity: medium

Summary

No tool declares outputSchema or returns structuredContent, although several already parse into typed data and then flatten it to text.

Where

  • mcp-server/src/tools/serviceHealth.ts:206-233
  • mcp-server/src/tools/healthCheck.ts:95-110
  • mcp-server/src/utils/fan-out.ts:18

Details

serviceHealth parses docker ps JSON with a zod schema; healthCheck builds CheckResult[]; forNodes returns only text.

Impact

Clients and agents that chain tools (fleet dashboards, "which nodes have unhealthy containers") must re-parse prose.

Suggested fix

Start with serviceHealth, healthCheck, piStatus, nodeList and backupStatus: declare outputSchema in registerTool and return both the current text and structuredContent. Let forNodes accept a structured per-node result and return { nodes: [{ name, host, ok, data | error }] }.

Open question: keep text output identical for prompts and skills?

Acceptance criteria

  • Listed tools return validated structuredContent
  • Text output unchanged

Getting started

  • Relevant files: mcp-server/src/tools/serviceHealth.ts, mcp-server/src/tools/healthCheck.ts, mcp-server/src/utils/fan-out.ts
  • How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
  • Conventions: see CLAUDE.md and CONTRIBUTING.md

Filed by repo-audit/full-audit at 636fefb. Severity: medium. Effort: M. audit-key: enhancement|mcp-server/src/utils/fan-out.ts|structuredContent

Vorherrschende Sprache
TypeScript
Sterne
0
Forks
4
Ø Merge
10 Std. 16 Min.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/Home-Lab-Developer-Tools

Alle Issues in TMHSDigital/Home-Lab-Developer-Tools

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.