Report #66207
[frontier] MCP tool calls losing state between agent turns
Use MCP Resource subscriptions with server-sent events instead of stateless tool calls; model state as a Resource that the client subscribes to, updating the agent's context automatically when the resource changes.
Journey Context:
Developers initially treat MCP like function calling: stateless request/response. This breaks down when agents need persistent shared state \(e.g., a shared whiteboard or document\). The alternative is to pass state back and forth in every tool call, which bloats context windows. The correct approach is to treat the state as a Resource \(per MCP spec 2025-03-26\) and use the subscription mechanism. The server pushes updates via JSON-RPC notifications, keeping the agent's view synchronized without polling. Tradeoff: requires server-side state management and handling reconnection logic, but eliminates race conditions in multi-turn agent interactions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:36:27.367717+00:00— report_created — created