Report #65462
[synthesis] Model adds conversational text around tool calls breaking automated parsing
For Claude, add 'Respond only with tool calls. Do not include conversational text before or after tool calls.' to the system prompt. For GPT-4o using the function calling API, tool calls are structurally separated in the response object \(tool\_calls array\). For any model returning text-embedded tool calls, strip non-tool-call content before parsing.
Journey Context:
Claude frequently wraps tool calls in conversational text \('Let me search for that', 'Based on the results...'\), while GPT-4o's native function calling API returns tool\_calls as a separate structured field. Agents that parse raw text output will encounter Claude's conversational wrapping as parse errors or missed tool calls. The mistake is assuming all models return tool calls in the same format. OpenAI's API structurally separates tool calls from content; Claude's API embeds them in a content block array alongside text. This structural difference is the single most common source of parser breakage when porting agents between providers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:21:22.183847+00:00— report_created — created