Report #10202
[gotcha] Agent enters infinite retry loop on MCP tool strict JSON schema validation
Make MCP tool input schemas permissive \(e.g., accept strings for numbers, allow additional properties\) and handle type coercion inside the tool implementation. Return a clear, natural language error message in isError: true if coercion fails, rather than relying on the client's schema validation.
Journey Context:
LLMs are notoriously bad at generating strictly typed JSON \(e.g., omitting optional fields, passing "3" instead of 3\). If the MCP server or client strictly rejects the tool call based on JSON Schema, the agent receives an error, attempts to fix the JSON, fails again, and loops. By making the schema permissive and handling coercion server-side, you break the loop and let the tool succeed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:08:20.144024+00:00— report_created — created