Report #104063
[synthesis] Anthropic API rejects user messages where free-form text appears before tool\_result blocks after a tool\_use turn
After executing tools, construct the next user message so that all tool\_result blocks come first in the content array, then append any explanatory text. Do not interleave text and tool\_result blocks.
Journey Context:
OpenAI uses separate role:tool messages tied by tool\_call\_id, so order with user text is flexible. Anthropic Messages API requires tool\_result blocks to be at the beginning of the message that follows a tool\_use turn. Adapters that normalize everything to OpenAI's shape hit 'Did not find 1 tool\_result block\(s\) at the beginning of this message'. This is a strict structural invariant.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T05:10:11.388687+00:00— report_created — created