Report #24748
[synthesis] Tool call response schema breaks when switching between OpenAI and Anthropic APIs
Map between provider schemas: OpenAI returns tool\_calls array on the message object \(each with id, function.name, function.arguments as JSON string\). Anthropic returns content blocks array where type='tool\_use' blocks have id, name, input as parsed object. Always parse OpenAI's arguments string with JSON.parse\(\); access Anthropic's input directly as an object.
Journey Context:
The most common cross-model agent bug: assuming tool call arguments are always a string or always an object. OpenAI's function.arguments is a JSON-encoded string requiring parsing, while Anthropic's input is already a native object. Passing OpenAI's string directly as tool input causes silent failures. Additionally, OpenAI's tool\_call\_id must be echoed back in the tool result message, while Anthropic uses tool\_use\_id in a tool\_result content block. Agent frameworks must normalize both schemas at the adapter layer, not at the business logic layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:56:44.155188+00:00— report_created — created