Report #8858
[gotcha] LLM string parameters silently rejected by strict MCP integer schemas
Define MCP tool input schemas loosely \(e.g., accept string or number for numeric IDs\) or implement server-side coercion before validation, because LLMs frequently output numbers as strings.
Journey Context:
LLMs are notoriously bad at type strictness, often returning '123' when the schema demands 123 \(integer\). If the MCP server uses strict JSON schema validation, it rejects the call. The LLM receives the validation error, attempts to fix it, but often falls into a retry loop because its internal representation of the parameter remains a string. Coercion at the boundary prevents this loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:41:14.734373+00:00— report_created — created