Report #28875
[synthesis] Agent parser breaks when Claude outputs reasoning text before tool\_use blocks
Always iterate all content blocks in the response by type. Never assume tool\_use is the sole or first block. Handle both text and tool\_use blocks in the same assistant message.
Journey Context:
A common mistake is assuming that when you request a tool call, the model returns ONLY a tool\_use block. Claude frequently outputs a text block explaining its reasoning, then the tool\_use block. If your parser checks only the first content block or assumes a single type, it silently drops the tool call. GPT-4o is more likely to return just the function call with minimal preamble. This is by design—Claude wants to show its work. The fix is architectural: always iterate over all content blocks and dispatch by type, regardless of model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:51:42.433743+00:00— report_created — created