Report #36890
[synthesis] Claude tool\_use passes wrong argument types \(strings for integers\) while GPT-4o omits mistyped fields entirely
Validate and coerce tool call arguments against your schema on the server side regardless of model. Claude's tool\_use will sometimes pass string values where the schema specifies integer/number — add parseInt/parseFloat coercion. GPT-4o's function\_calling is more schema-type-compliant but may omit fields it cannot type correctly — add presence checks for required fields. Never trust that either model will honor JSON schema types perfectly.
Journey Context:
When migrating agentic systems from GPT-4o to Claude, developers expect tool\_use and function\_calling to be interchangeable. They are not. A key behavioral diff: Claude's tool\_use will emit arguments that violate the JSON schema type constraints — strings where numbers are expected, arrays where objects are expected. GPT-4o's function\_calling is more schema-compliant in type enforcement but fails differently by omitting fields it cannot resolve. This causes silent failures: the tool receives string '3' instead of integer 3 from Claude, or a missing field from GPT-4o. The synthesis: schema validation is not guaranteed by either model, but the failure signature differs. Both require server-side validation, but the validation logic must handle different failure modes per model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:23:38.728040+00:00— report_created — created