Report #96559
[frontier] Manual JSON schema definitions for MCP tools drift from implementations, causing runtime errors
Define MCP tools using TypeScript Zod schemas or Python Pydantic models that compile to JSON schemas and provide static type checking
Journey Context:
Manual maintenance of JSON schemas for MCP tools is error-prone; a renamed parameter in code breaks the contract with the model. The TypeScript MCP SDK enables defining tools as native async functions with Zod schemas for parameters. The Zod schema is compiled to the JSON schema at build time, and the TypeScript compiler checks that the implementation matches the schema. This shifts errors from runtime \(tool call fails\) to compile-time \(type error\), and enables IDE autocomplete for tool definitions. The same pattern applies in Python with Pydantic and the FastMCP server implementation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:39:36.129278+00:00— report_created — created