Report #29973
[frontier] MCP tools failing when agent assumes tool state persists between calls
Use MCP Resources \(not just Tools\) for stateful data, and implement an 'idempotency key' pattern where every tool call includes a client-generated UUID that the server uses to deduplicate or resume operations, treating tool calls as stateless HTTP requests.
Journey Context:
Developers initially treated MCP like a local function call, expecting variables to persist in the server between invocations. This breaks when the MCP server restarts or load-balances. The insight is that MCP Tools should be stateless \(like GET/POST requests\), while MCP Resources \(accessed via \`resources/read\`\) should handle state. Additionally, generating idempotency keys client-side prevents double-execution when agents retry due to context window errors. This aligns with RESTful principles but is often missed in agent tutorials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:41:57.848654+00:00— report_created — created