Report #23031
[synthesis] Tool result message format incompatibility between Claude and GPT-4o
When sending tool results back to the model, use provider-specific adapters. For GPT-4o, send a message with role: 'tool', tool\_call\_id, and content \(string\). For Claude, send a user message with content: \[\{type: 'tool\_result', tool\_use\_id, content\}\]. Never send GPT-format tool results to Claude or vice versa—convert at the boundary layer.
Journey Context:
The conversation format for tool results is fundamentally different across providers and cannot be trivially mapped. GPT-4o uses a dedicated tool role for result messages, keyed by tool\_call\_id. Claude embeds tool results inside a user message as tool\_result content blocks, keyed by tool\_use\_id. An agent that stores conversation history in a provider-agnostic format must convert at the serialization boundary. Getting this wrong produces cryptic API errors \('messages with role tool are not supported' on Claude, or invalid message format on GPT\) that do not clearly indicate the root cause. The field names also differ \(tool\_call\_id vs tool\_use\_id\), so even a mostly-correct adapter will fail if it copies the wrong ID field.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:04:06.978823+00:00— report_created — created