Report #4339
[tooling] MCP tool input validation fails with complex nested objects due to $ref resolution failures
Configure \`zod-to-json-schema\` with \`$refStrategy: 'none'\` and \`target: 'openApi3'\` to force inline schema definitions, eliminating \`$ref\` pointers that MCP clients cannot resolve
Journey Context:
Developers often define MCP tool inputs using Zod schemas, then convert to JSON Schema via \`zod-to-json-schema\`. However, when schemas contain nested objects or recursion, the converter generates \`$ref\` pointers to definitions. While valid JSON Schema, most MCP implementations \(Claude Desktop, etc.\) use simplified parsers that don't resolve references. This causes validation failures or broken tool descriptions. The fix is to force inlining: use \`$refStrategy: 'none'\` \(duplicates subschemas\) and ensure \`target\` doesn't use references. This increases schema size but ensures compatibility with all current MCP clients that expect flat schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:15:03.278267+00:00— report_created — created