Same failure shape on our side this week. A 409 on a label conflict told the agent nothing about the current label: the label in the backend's details was an object and the MCP layer only forwarded integers. The guidance said "call again to see the label", and the call returned the same bare conflict. The fix, deployed to staging on November 20, makes the 409 carry the current label, the first label, the version and who set it, plus "don't repeat the call". Your third point is the one we got wrong: the instructions promised something the implementation didn't deliver. Did your regression test check the guidance text too, or only the error?
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
The test checked the error text for the task ID and a useful hint. The scheduling instructions changed in the same PR, and the test didn’t exercise them. Your staging example is a good case for following the guidance in the test and asserting that the current label and version actually come back through MCP.
The NanoClaw example where a bare "task not found" made agents recreate tasks as duplicates is a great illustration. One tip that pairs well with your fixes: make the create-task tool idempotent, for example by checking for an existing task with the same name or schedule first, so even a wrong guess doesn't produce a duplicate.
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
Yep, I’d give create_task an idempotency key and reuse it when retrying the same create request. Two legitimate tasks can share a name and schedule, so I’d use that match to flag a possible duplicate before creating anything.
Good framing — the rule I'd add to your list is to make the error verifiable, not just descriptive. An error that says "task exists in another session, check get_task " is already better, but the agent still has to trust the text. When the error names the exact read that would confirm the state, the agent can check instead of inferring — and the check either confirms it or exposes a stale error. That also makes errors part of the tool's contract: if you change an error string, you can change agent behavior just as surely as changing a tool schema, so errors deserve the same regression tests as the happy-path outputs.
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
I like the distinction. If the error points to a specific task ID, I’d test the whole recovery path: trigger the error from a sibling session, follow the lookup it suggests, and check that the tool actually returns that task. That would catch the guidance drifting out of sync with the tool.
One data point for "say where it is and what to do next". We gave an agent a stale-write conflict error that listed the current labels unquoted, one spelled like the version (v3 at version 3), under a prompt telling it not to re-read. It took the label for the version number and resent its old list: the other writer's change was lost in 38 of 48 runs. Same error with the labels quoted: 0 of 48. The wording of an error is part of the API.
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
The v3 example makes it easy to see how the model got there. I’d give labels: ["v3"] and version: 3 their own fields, then require the expected version on the write. If the agent still sends a stale update, the server can reject it before it overwrites the other writer’s change.
Agreed, and it's the half most servers skip. In our lost-update tests the version usually existed: Grafana dashboards carry one and the tool forced the overwrite past it; Kubernetes objects carry a resourceVersion and the server re-applied a stale copy without it. The field was there. Nobody required it on the write.
Building persistent memory for AI agents at Mnemoverse.
I write about the unglamorous half: forgetting, contradiction, and the moment an agent confidently repeats a fact you retracted.
A uniform 401 is the auth version of the "403" in your first rule. On 17 November I sent four requests to each of six hosted memory APIs: a fake key in the header the vendor documents, the same key in another header, no key, and a made-up path. Two of the six gave the same 401 to all four. The likeliest reading is a bad key, so an agent that wrote the call would ask the user for a new one, and a new key fixes neither a wrong header nor a wrong path. The usual argument for one answer to everything is to tell an untrusted caller as little as possible, and a split between a missing key and a wrong one keeps to it. One of the six answered the fake key with "Invalid API key format" and the request without a key with "API key required", and both describe only what was sent.
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
That’s a useful distinction. “API key required” tells the agent to check whether it sent the credential in the expected header, which is a much better first move than asking the user to rotate a key. You can give that hint without revealing whether the requested resource exists.
Making the error verifiable matters most to me. The agent can check its own fix instead of asking again, and each ask is another turn that resends the session.
AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.
Agreed. If the agent has permission to read the task, give it the task ID and the lookup to run. It can confirm what happened in the same turn and save the question for a decision the user actually needs to make.
We're a place where coders share, stay up-to-date and grow their careers.
Same failure shape on our side this week. A 409 on a label conflict told the agent nothing about the current label: the label in the backend's details was an object and the MCP layer only forwarded integers. The guidance said "call again to see the label", and the call returned the same bare conflict. The fix, deployed to staging on November 20, makes the 409 carry the current label, the first label, the version and who set it, plus "don't repeat the call". Your third point is the one we got wrong: the instructions promised something the implementation didn't deliver. Did your regression test check the guidance text too, or only the error?
The test checked the error text for the task ID and a useful hint. The scheduling instructions changed in the same PR, and the test didn’t exercise them. Your staging example is a good case for following the guidance in the test and asserting that the current label and version actually come back through MCP.
The NanoClaw example where a bare "task not found" made agents recreate tasks as duplicates is a great illustration. One tip that pairs well with your fixes: make the create-task tool idempotent, for example by checking for an existing task with the same name or schedule first, so even a wrong guess doesn't produce a duplicate.
Yep, I’d give create_task an idempotency key and reuse it when retrying the same create request. Two legitimate tasks can share a name and schedule, so I’d use that match to flag a possible duplicate before creating anything.
Good framing — the rule I'd add to your list is to make the error verifiable, not just descriptive. An error that says "task exists in another session, check get_task " is already better, but the agent still has to trust the text. When the error names the exact read that would confirm the state, the agent can check instead of inferring — and the check either confirms it or exposes a stale error. That also makes errors part of the tool's contract: if you change an error string, you can change agent behavior just as surely as changing a tool schema, so errors deserve the same regression tests as the happy-path outputs.
I like the distinction. If the error points to a specific task ID, I’d test the whole recovery path: trigger the error from a sibling session, follow the lookup it suggests, and check that the tool actually returns that task. That would catch the guidance drifting out of sync with the tool.
One data point for "say where it is and what to do next". We gave an agent a stale-write conflict error that listed the current labels unquoted, one spelled like the version (v3 at version 3), under a prompt telling it not to re-read. It took the label for the version number and resent its old list: the other writer's change was lost in 38 of 48 runs. Same error with the labels quoted: 0 of 48. The wording of an error is part of the API.
The v3 example makes it easy to see how the model got there. I’d give labels: ["v3"] and version: 3 their own fields, then require the expected version on the write. If the agent still sends a stale update, the server can reject it before it overwrites the other writer’s change.
Agreed, and it's the half most servers skip. In our lost-update tests the version usually existed: Grafana dashboards carry one and the tool forced the overwrite past it; Kubernetes objects carry a resourceVersion and the server re-applied a stale copy without it. The field was there. Nobody required it on the write.
A uniform 401 is the auth version of the "403" in your first rule. On 17 November I sent four requests to each of six hosted memory APIs: a fake key in the header the vendor documents, the same key in another header, no key, and a made-up path. Two of the six gave the same 401 to all four. The likeliest reading is a bad key, so an agent that wrote the call would ask the user for a new one, and a new key fixes neither a wrong header nor a wrong path. The usual argument for one answer to everything is to tell an untrusted caller as little as possible, and a split between a missing key and a wrong one keeps to it. One of the six answered the fake key with "Invalid API key format" and the request without a key with "API key required", and both describe only what was sent.
That’s a useful distinction. “API key required” tells the agent to check whether it sent the credential in the expected header, which is a much better first move than asking the user to rotate a key. You can give that hint without revealing whether the requested resource exists.
Making the error verifiable matters most to me. The agent can check its own fix instead of asking again, and each ask is another turn that resends the session.
Agreed. If the agent has permission to read the task, give it the task ID and the lookup to run. It can confirm what happened in the same turn and save the question for a decision the user actually needs to make.