Skip to content

Type MCP tools/list responses in OpenAPI and the generated SDK #281

Description

@lamenting-hawthorn

Problem

GET /api/v1/mcp-servers/{name}/tools currently documents every MCP tool as an untyped Record<string, unknown>. Generated OpenAPI and SDK consumers therefore cannot discover standard MCP tool fields such as the name, description, input/output JSON schemas, annotations, icons, or execution metadata.

The route already contains a TODO to type this response.

Proposed scope

  • Add named, reusable Zod/OpenAPI schemas for the MCP tool wire shape.
  • Preserve MCP-designated _meta, nested JSON Schema extension fields, and TrueForge's existing preload hint.
  • Use the typed item schema in ListMcpServerToolsResponse.
  • Regenerate the committed OpenAPI documents and TypeScript SDK through the repository generator.
  • Add contract tests for representative tool metadata and the production route.

Expected behavior

The endpoint path and response envelope remain unchanged, while OpenAPI and generated SDK clients expose standard MCP tool fields as typed properties. The generated TypeScript SDK follows its normal naming convention by exposing wire _meta as meta; its serializer continues to read and write _meta on the HTTP wire.

Non-goals

  • Preserving arbitrary unknown top-level tool properties that the upstream MCP SDK does not retain.
  • Changing MCP tool execution behavior.
  • Changing approval policy.
  • Hand-editing generated OpenAPI or SDK files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions