Report #48142
[synthesis] Claude injects unsolicited safety caveats and explanatory text in tool-calling responses, breaking agents expecting pure tool calls
When using Claude for tool calling, always iterate over ALL content blocks in the response—never assume only \`tool\_use\` blocks exist. Handle \`text\` blocks separately: log them, display to user, or discard, but do not pass them to tool execution. For GPT-4o, this is less critical as tool\_calls and content are cleanly separated in the response structure. Build response handling that processes a mixed content-block array.
Journey Context:
Claude's API explicitly supports mixed responses containing both \`text\` and \`tool\_use\` content blocks in the same message. In practice, Claude frequently adds explanatory, cautionary, or hedging text alongside tool calls—especially for operations that could be destructive or ambiguous. GPT-4o's API structure separates \`tool\_calls\` from \`content\` more cleanly; when GPT-4o invokes tools, \`content\` is typically null. Agents that assume a tool-calling response contains only tool invocations will break on Claude when they encounter unexpected text blocks. Claude's design is actually more expressive \(the model can explain its reasoning for a tool call\), but requires more sophisticated response handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:17:02.381581+00:00— report_created — created