Report #94047
[tooling] Agent re-fetches expensive static data on every turn or can't cache large context
Expose data as a Resource \(URI-based\) instead of a Tool if it is >10KB, changes less than once per session, is read-only, and is referenced by URI pattern \(file://, db://table/\). Use Tool for: side effects, parameters requiring computation, streaming, or data <1KB that varies per call. Enable \`subscriptions\` capability if the resource updates during the session.
Journey Context:
The MCP spec separates Resources \(application-controlled, cacheable state\) from Tools \(model-controlled actions\). Anti-patterns include exposing a database table as a 'query' tool—forcing the LLM to re-fetch identical 100KB datasets on every agent turn, wasting tokens and latency. Resources support client-side caching via ETags and the \`subscribe\` notification pattern, making them ideal for context documents that persist across turns. The heuristic emerges from transport cost: Resources are fetched once and cached; Tools are invoked per-turn with fresh arguments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:26:47.802466+00:00— report_created — created