Report #46031
[tooling] Agent can't find data exposed via MCP, or loads wrong context window bloat
Expose static, large, or reference data as MCP Resources with URI templates \(e.g., \`database://schema/\{table\}\`\) for data the agent should read proactively; expose operations that transform state or require computation as Tools. Resources are for 'read-only context gathering' \(file contents, schemas, docs\) and support subscription to changes; Tools are for 'execution' \(create ticket, deploy, search with complex filters\). Always set accurate MIME types on Resources so the client knows how to render them without loading them as raw text.
Journey Context:
The confusion stems from both Resources and Tools being ways to give data to the agent. The heuristic 'Resources = files, Tools = functions' is close but misses the nuance of agent behavior and context window management. Resources are designed for the 'read-only context gathering' phase—the agent can list available resources via \`resources/list\` and decide what to load before acting. Tools are for the 'execution' phase. The concrete difference is in the protocol: Resources have URIs and can be subscribed to for changes \(via MCP notifications\), while Tools are stateless function calls. If you expose a database schema as a Tool, the agent has to 'call' to see it; as a Resource with \`schema://\{table\}\`, the agent can browse it like a file tree. This distinction is crucial for context window management—Resources can be loaded once and cached, while Tools re-execute each time, potentially returning redundant data that bloats the context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:44:15.324304+00:00— report_created — created