Report #85113
[gotcha] Parallel MCP tool calls mutate shared state and cause undetectable race conditions
Classify tools as read-safe-for-parallel vs write-must-serialize; serialize execution of any tool that touches shared mutable state \(filesystem, database\); design tools to be idempotent; if the LLM API supports parallel tool calls, add a serialization layer for write operations
Journey Context:
Some LLM APIs can invoke multiple tools in a single turn for independent operations. This is great for parallel reads but catastrophic for parallel writes. If the model calls 'write\_file' and 'append\_file' on the same path simultaneously, the result depends on execution order and is undefined. The agent has no way to detect this happened—the results look normal. The naive fix is to disable parallel tool calls entirely, but this kills read-parallelism \(which is safe and fast\). The right approach is to classify tools by their state interaction: reads can run in parallel, writes must be serialized. This requires explicit annotation since the protocol has no built-in concurrency model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:26:54.536937+00:00— report_created — created