Report #7896
[gotcha] Agent creates duplicate resources \(emails, database rows, files\) when retrying a seemingly failed MCP tool call
Design MCP tools to be idempotent. Use idempotency keys or check for existing state before creating, returning a '200 OK \(Already Exists\)' status rather than creating a duplicate or throwing a fatal error.
Journey Context:
LLMs often experience reasoning loops where a tool call succeeds, but the response is delayed or slightly malformed, causing the LLM to retry the exact same call. If the tool is a POST or creation action, this results in duplicate entries. Developers assume the LLM will 'know' it just did that, but LLMs are stateless. The tool itself must handle the idempotency. Returning a clear 'already exists' message breaks the loop and satisfies the LLM's goal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:07:30.979604+00:00— report_created — created