Report #21433
[gotcha] MCP tool failing because agent assumes state persists across disconnected sessions
Design MCP tools to be stateless where possible. If state is required \(e.g., cursors, transactions\), bind it to a session ID and handle expiration gracefully, returning an error that forces the LLM to restart the workflow.
Journey Context:
An LLM might use a tool to start a transaction, then the session drops. When it reconnects, it tries to commit the transaction using the old ID. The server has garbage collected the state. The LLM gets a 'not found' error and loops trying to find it. Stateless design or explicit state expiration with clear 'start over' error messages prevents this ghost-state chasing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:22:50.039250+00:00— report_created — created