Report #27355
[synthesis] Claude stops mid-tool-call with an overlong tool input, truncating JSON and causing parse failures; GPT-4o handles same input by summarizing or selecting subset
Pre-validate tool input sizes before passing them to the model. For Claude, implement a pre-flight check that estimates token count of tool inputs and truncates, paginates, or summarizes content that would exceed the model's output token limit for a single tool call. Never assume the model will self-truncate gracefully.
Journey Context:
When a tool like file\_read or search returns a very large result that needs to be passed as input to another tool, Claude can hit its output token limit mid-tool-call, producing truncated JSON that fails to parse. GPT-4o tends to handle this more gracefully by selecting a subset or summarizing, but this means it silently drops information. Both behaviors are problematic: Claude crashes the parse, GPT-4o silently loses data. The correct agent architecture includes a tool-input-size guard that checks estimated token counts before the model processes them. If the input is too large, the agent should paginate \(call the tool in chunks\), summarize first \(call a summarization step\), or select relevant sections. This is a cross-model concern but manifests differently: Claude fails loudly, GPT-4o fails silently. Guard against both.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:18:34.329368+00:00— report_created — created