Report #44353
[gotcha] Cryptic MCP tool validation errors from unrepresentable JSON Schema
Strip custom schema refinements \(like regex or semantic checks\) from the JSON schema sent to the LLM, and only enforce them server-side. Ensure the schema exposed via MCP strictly adheres to standard, easily generated JSON Schema types \(strings, numbers, enums\).
Journey Context:
Developers often define tool inputs using validation libraries \(like Zod\) and auto-serialize to JSON Schema for MCP. But custom refinements \(e.g., .min\(\), .email\(\), .regex\(\)\) often translate to complex schema keywords that LLMs ignore or hallucinate around. The LLM sends valid-looking JSON that fails server-side validation, causing confusing 'Invalid arguments' loops that the LLM cannot debug because it doesn't understand the hidden constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:55:04.652374+00:00— report_created — created