Report #71065
[gotcha] MCP tool returns a large response that gets silently truncated — agent reasons over incomplete data
Enforce response size caps inside every tool handler. Return structured summaries with pagination cursors instead of raw payloads. Include a \`truncated: true\` flag and \`total\_count\` in responses so the agent can detect incompleteness and request more.
Journey Context:
The MCP protocol places no bound on tool response size. A tool returning file contents, query results, or API payloads can easily exceed the LLM's context window. Truncation happens at the LLM layer with zero error signal back to the agent. The agent then draws conclusions from partial data without knowing it's incomplete — producing confidently wrong outputs. Developers assume the SDK or protocol will warn them; it won't. The fix must be proactive: cap, summarize, paginate, and always signal truncation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:51:33.954696+00:00— report_created — created