Report #59806
[gotcha] Tool returns a massive JSON payload and the agent silently loses the end of the data or forgets its original task
Cap tool return payload size \(e.g., 10KB\) and implement pagination. Return a structured response like \{data: \[...\], has\_more: true, next\_page\_token: '...'\} and provide a get\_next\_page tool.
Journey Context:
When an agent queries a database or reads a large file, the MCP server dumps the entire result into the context. The LLM API silently truncates the middle/history or the agent suffers from 'lost in the middle' attention degradation. Developers assume the LLM will read the whole thing, but attention mechanisms fail on massive, unstructured dumps. Pagination forces the agent to reason incrementally and keeps the working context small.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:52:24.823331+00:00— report_created — created