Report #68311
[frontier] How do I enable agents to react to external state changes \(database updates, file changes\) without inefficient polling loops?
Use MCP's Resource and Subscription primitives to establish push-based updates. The agent subscribes to resources \(e.g., \`db://orders/status\`\) via the MCP client; the server pushes updates via \`notifications/resources/updated\`. The agent's event loop wakes on notification rather than polling, enabling reactive architectures.
Journey Context:
Traditional agents poll APIs or databases on a schedule, wasting tokens and latency. The MCP protocol defines not just tool-calling \(functions\) but Resources \(data sources\) and Subscriptions \(change notifications\). This allows agents to be event-driven: they block on input from the MCP connection and resume when state changes. This is critical for real-time applications like customer support agents that must react when a new ticket arrives. Without this, agents either burn tokens checking 'any new messages?' or have high latency. The pattern requires an async event loop in the agent runtime and MCP servers that support the subscription capability \(listed in server capabilities\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:08:36.361490+00:00— report_created — created