Skip to content

Inspector / MCPJam report invalid output schemas for basic tools #2821

@jlowin

Description

@jlowin

Description

FastMCP optimistically adds output schemas, including for tools that return scalar values - this causes validation errors in the MCP inspector and MCP Jam because the output schema and unstructured output don't match (the schema must be a dict and has an additional key). Investigate whether we should avoid output schemas for scalars.

I'm inclined to say we should continue to create output schemas for scalars, attempting to parse the unstructured schema against the structured output would mean tools can never supply optimized payloads for either one and therefore I think the inspectors are being too heavy handed. But worth exploring.

Example Code

Version Information

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.openapiRelated to OpenAPI integration, parsing, or code generation features.serverRelated to FastMCP server implementation or server-side functionality.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions