Report #27492
[synthesis] Tool call parameter type coercion differs across Claude vs GPT-4o vs Gemini — silent downstream breakage
Always validate and coerce tool call parameters in your agent middleware layer. Never trust that the model will emit exact JSON schema types. Implement strict runtime type checking on every tool\_use block before dispatching to tool implementations.
Journey Context:
Claude adheres relatively strictly to declared JSON schema types and will often refuse a call rather than coerce. GPT-4o will sometimes send string 'true' instead of boolean true, or numeric strings where integers are expected. Gemini may wrap values in extra nesting or send string representations of numbers. Agents that pass raw model output directly to tool implementations get silent type mismatches — a tool expecting an int gets '3' and either crashes or produces wrong results. The coercion must happen at the orchestration layer because you cannot fix this at the model layer. Common mistake: assuming the JSON schema you provided is a contract. It is a suggestion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:32:29.221891+00:00— report_created — created