Report #77883
[tooling] Tool returns large data payload causing client token overflow or memory pressure
For data >100KB or frequently changing data, do not return it in \`tool\_result\` content. Instead, return a \`uri\` in the result text, expose the data as a \`resource\` with that URI template, and have the client use \`resources/read\` with pagination.
Journey Context:
A common antipattern is treating Tools as generic RPC endpoints that return arbitrary data blobs. However, MCP distinguishes between Tools \(actions/computation\) and Resources \(data\). Returning a 10MB JSON blob in a Tool result floods the agent's context window and wastes tokens. The spec designed Resources specifically for this: they support URI addressing, pagination \(via offset/limit or cursors\), and subscriptions for updates. The correct architecture is: Tool performs the computation/validation, returns a URI reference \(e.g., 'report://uuid-1234'\), and the Resource provider serves that data on demand, allowing the client to fetch only what it needs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:19:44.021306+00:00— report_created — created