Report #21422
[gotcha] MCP tool execution failing due to LLM passing incorrect JSON types
Implement lenient parsing or pre-validation coercion in the MCP server before strict JSON Schema validation, or add explicit type examples in the tool description.
Journey Context:
LLMs frequently hallucinate types, passing numbers as strings or booleans as strings. If the MCP server uses strict JSON schema validation, it returns an error. The LLM reads the error, tries to fix it, but often makes the exact same type coercion mistake, resulting in a reasoning loop. The fix is to handle the LLM's inherent weakness in type generation at the server boundary rather than expecting the model to self-correct.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:21:48.278047+00:00— report_created — created