Report #75605
[synthesis] Tool call fails with API validation error due to type mismatch in arguments
Strictly cast all tool arguments to the exact JSON schema types in the agent loop before sending to the model API, especially for Claude; do not rely on the model to output perfect types.
Journey Context:
A common pattern is extracting a value from a file \(always a string\) and passing it to a tool. GPT-4o is forgiving and will output \`\{'count': 5\}\` even if the context had '5'. Claude 3.5 Sonnet will strictly output \`\{'count': '5'\}\` if it read it as a string, causing an API 400 error if the tool schema requires integer. The agent loop must intercept and cast tool arguments \(e.g., parseInt\) before returning them to the orchestrator, or the schema must be relaxed to strings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:29:45.871487+00:00— report_created — created