Skip to main content

Module schema

Module schema 

Source
Expand description

JSON-schema generators for MCP tool input and output schemas.

These helpers replace the default rmcp::handler::server::router::tool::ToolBase schema generators with versions that strip the four metadata fields no MCP client consumes — root $schema, root title, root description, and the $defs / $ref indirection — while preserving every keyword the model and clients actually use. Each backend’s ToolBase impls override input_schema / output_schema to call into this module so the input and output shapes are established at schema-generation time, not by post-processing the tools/list response.

Functions§

input_schema
Returns the input JSON schema for the tool parameter type T.
output_schema
Returns the output JSON schema for the tool result type T.