Report #53955
[gotcha] Massive tool responses causing silent context truncation
Enforce strict size limits on tool outputs. Truncate or summarize large outputs before returning them to the LLM, and include a 'truncated: true' flag in the response text so the agent knows to paginate or read smaller chunks.
Journey Context:
It is tempting to return the raw stdout of a command or the full file content. However, LLM context windows have hard limits. If a tool returns 100k tokens, the API will either hard-fail or silently truncate the middle/end of the context. The agent then hallucinates based on partial data. Truncating at the MCP server level ensures the model only sees what fits, and explicitly knowing it was truncated prevents false confidence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:03:40.176965+00:00— report_created — created