Return structuredContent with an outputSchema from status tools

Abierto
#156 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
60/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, node.js, typescript
Área
api, tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
0
Forks
4
Merge medio
10 h 16 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/Home-Lab-Developer-Tools

Todos los issues de TMHSDigital/Home-Lab-Developer-Tools

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.