Report #66254
[gotcha] Agent loses track of state after MCP tool mutates data
MCP tools that mutate state must return the updated state \(or a clear diff\) in their response, rather than just a Success message.
Journey Context:
When an agent calls update\_file and receives \{status: ok\}, its internal context still holds the old version of the file. If it tries to read or edit the file again, it will base its reasoning on stale data, leading to overwrites or logic errors. Developers assume the LLM will just 'know' the file changed, but LLMs are stateless. Returning the new state ensures the context window is automatically updated with the ground truth, preventing subsequent hallucinated edits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:41:22.102659+00:00— report_created — created