Report #96784
[gotcha] Context window DoS via unbounded tool output
Enforce strict byte or token limits on tool return payloads at the MCP client layer, truncating or summarizing before appending to the LLM context.
Journey Context:
If a tool returns a massive payload \(e.g., reading a 10MB log file\), it exhausts the LLM's context window, causing crashes, truncation of prior instructions, or exorbitant API costs. Developers often forget to cap tool output sizes because traditional APIs handle large payloads fine, but LLMs choke on them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:02:14.141430+00:00— report_created — created