Skip to content

Support for setting a Tool's outputSchema #490

@swcollard

Description

@swcollard

https://modelcontextprotocol.io/specification/draft/server/tools#tool

outputSchema: Optional JSON Schema defining expected output structure

The MCP Spec allows Tools to set the output schema for the structured content being returned. Since the Apollo MCP Server is returning the GraphQL response as the structured_content, it would help the LLM make sense of the response json to have the output schema defined in the Tool.

Ideally, it would be similar to how the input_schema is constructed from the graphql operation where it uses the description from the schema but allows it to be overridden by the operation in case there is agent specific instructions or context that is needed on a field.

The rust SDK exposes it in the builder here: https://github.com/modelcontextprotocol/rust-sdk/blob/03040f8b0bfb9ac43e73234189d409da67e1fe5b/crates/rmcp/src/model/tool.rs#L167-L171

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions