Report #47605
[synthesis] Parsing errors when LLMs append or prepend conversational text to tool call outputs
For Claude, explicitly instruct 'Output ONLY the tool call XML/JSON block with no conversational text' or use the native tool\_use block. For Gemini, set the temperature to 0 and use strict function calling mode. For GPT-4o, rely on the native \`tool\_calls\` array in the API rather than parsing raw text.
Journey Context:
Agents parsing raw text outputs often crash on Claude's polite preambles or Gemini's markdown formatting. Using native API tool-calling endpoints avoids this, but if forced to use raw text/JSON mode, Claude requires negative constraints \('Do not explain, just call'\), while GPT-4o requires positive constraints \('Call the function'\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:22:50.613011+00:00— report_created — created