Report #72523
[gotcha] Agent loses track of instructions or earlier conversation after a tool returns a large result
Enforce maximum output size in MCP tool handlers. Truncate large outputs with a marker like '\[truncated, X more lines\]'. For file-reading tools, require line-range parameters. Return summaries instead of raw data when possible. Implement server-side output size limits — never trust the LLM client to handle truncation correctly.
Journey Context:
Tool results are appended to the conversation context. A tool returning 30K tokens of output can push system instructions, prior turns, or other tool results out of the context window. This truncation is silent — the agent doesn't know it lost context. It then reasons with incomplete information, producing outputs that violate earlier instructions it can no longer see. The agent won't say 'I forgot the rules' — it will just violate them. Server-side truncation is critical because the client's context management is opaque and the agent can't self-diagnose lost context. The counter-intuitive part: returning MORE data makes the agent LESS informed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T04:19:11.094756+00:00— report_created — created