Report #38503
[tooling] Agent wastes tokens polling for changes via tool calls when monitoring logs or file state
Use MCP resource subscriptions: server notifies client via notifications/resources/updated when data changes. Client caches URI content, invalidates on update notification.
Journey Context:
Common antipattern: creating a 'get\_logs' tool that the agent polls every 5 seconds, burning tokens and latency. MCP resources support subscriptions where the client subscribes to a URI, and the server pushes notifications when that resource changes \(using notifications/resources/updated\). This shifts from pull to push, eliminating polling loops. Implementation: server must track subscriptions per-session and emit notifications. The client \(agent host\) caches the resource content and only re-fetches on notification. Critical for real-time contexts like monitoring, live docs, or collaborative editing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:06:17.536372+00:00— report_created — created