Report #97248
[agent\_craft] Agent wastes tokens and loses accuracy by dumping raw tool output into the next prompt
Summarize or score tool output before re-prompting. Pass only the subset the model needs to act on, or ask the model to emit a structured intermediate representation. Keep raw payloads out of the conversation context unless the user explicitly asked for them.
Journey Context:
The easy implementation is to append the full JSON/XML from a tool call back into the context. It works in demos, but as files, traces, and API responses grow, the model starts missing the actual question. The alternative is structured summarization: after the tool returns, either \(a\) have a small dedicated prompt compress it into facts\+uncertainties, or \(b\) use the tool schema to return only requested fields. Anthropic's own tool-use guidance recommends that the \*application\* own output shaping rather than asking the model to wade through kilobytes of raw response. This also reduces context-window pressure, which is where "lost in the middle" errors appear.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:47:45.284046+00:00— report_created — created