This is the same problem online shops have had forever, just with an agent in the middle now. The payment API says "success": true, everyone relaxes, and then the order email never went out or the stock didn't update because a webhook fired twice. The 200 response only tells you the request landed, not that the thing the customer wanted actually happened.
What's worked best for me is boring read-after-write: after the call, go fetch the record again and check the fields you care about, instead of trusting the response body. Plus an idempotency key on anything that touches money, so a retry can't do it twice.
Do you think that check belongs inside the MCP tool itself, or should the agent be the one verifying?
I'd put the critical verification inside the MCP tool, with the agent responsible for interpreting the result and deciding what to do next.
The tool should guarantee that a successful response means the operation was actually confirmed — not merely that the API accepted the request. The agent shouldn't have to remember to verify every payment or risk silently skipping that step. Read-after-write checks and idempotency keys are good defaults for anything involving money.
The agent still needs to handle cases where verification fails or the result is uncertain, but I'd rather make the safe path the default than rely on the agent to remember every safeguard. Especially when retries are involved.
Agreed, making the safe path the default is the right call. If every agent has to remember to verify, one of them eventually won't. Retries are where it gets scary, so idempotency at the tool level just removes a whole class of "it charged twice" bugs.
Exactly. I'd also separate verification from execution as much as possible.
A retry shouldn't mean blindly repeating the original operation. Ideally, the tool should first determine whether the previous attempt actually completed, then decide whether another execution is safe.
That's especially important when an agent loses the response after a successful operation. From its perspective, the request failed, but the external system may have already processed it.
Idempotency helps, but I think the real goal is making the tool reliable even when the agent has incomplete information about what happened.
The lost response case is the nasty one. A payment API times out, the agent thinks it failed, but the charge already went through on the other end. "Check before you retry" covers that, and blind retries are exactly what turn one bug into a customer complaint.
Exactly. A timeout tells you that the caller didn't receive a response, not that the operation failed. That's an important distinction, especially with payments or any action that can't safely be repeated.
I'd make the recovery path explicit: check the operation's status using an idempotency key or transaction reference before deciding whether to retry. If the result is still ambiguous, stop and escalate rather than guess. An agent should be able to recover from uncertainty without turning it into a duplicate action.
Splitting this across two boundaries works best in practice:
Inside the MCP server: enforce preconditions, optimistic concurrency (ETag/version tokens), and return the post-mutation readback instead of a bare { "success": true }. The server owns domain invariants.
In the orchestrator/harness: treat every tool output as a claim, not proof, and verify cross-tool postconditions with an independent read before advancing—recording those read receipts alongside the action log so partial failures stay auditable.
I really like this split. The MCP server should guarantee that the operation respects the domain rules, while the orchestrator should make sure the intended outcome actually happened across the whole workflow.
The read receipts are an especially good idea. A successful tool call is easy to log, but having independent evidence of the resulting state makes debugging partial failures much less ambiguous. It also creates a useful audit trail when something goes wrong several steps later.
Basically, trust the server to enforce the rules, but never let the workflow confuse a successful response with a completed outcome.
Exactly. A successful tool response only tells us that an operation completed, not that it produced the intended outcome. The distinction becomes especially important in agentic workflows, where several individually successful steps can still lead to an incorrect final state. I think end-state verification should be treated as a first-class part of the workflow, not an optional check after execution. The real definition of success is whether the user's goal was actually achieved.
We're a place where coders share, stay up-to-date and grow their careers.
This is the same problem online shops have had forever, just with an agent in the middle now. The payment API says "success": true, everyone relaxes, and then the order email never went out or the stock didn't update because a webhook fired twice. The 200 response only tells you the request landed, not that the thing the customer wanted actually happened.
What's worked best for me is boring read-after-write: after the call, go fetch the record again and check the fields you care about, instead of trusting the response body. Plus an idempotency key on anything that touches money, so a retry can't do it twice.
Do you think that check belongs inside the MCP tool itself, or should the agent be the one verifying?
I'd put the critical verification inside the MCP tool, with the agent responsible for interpreting the result and deciding what to do next.
The tool should guarantee that a successful response means the operation was actually confirmed — not merely that the API accepted the request. The agent shouldn't have to remember to verify every payment or risk silently skipping that step. Read-after-write checks and idempotency keys are good defaults for anything involving money.
The agent still needs to handle cases where verification fails or the result is uncertain, but I'd rather make the safe path the default than rely on the agent to remember every safeguard. Especially when retries are involved.
Agreed, making the safe path the default is the right call. If every agent has to remember to verify, one of them eventually won't. Retries are where it gets scary, so idempotency at the tool level just removes a whole class of "it charged twice" bugs.
Exactly. I'd also separate verification from execution as much as possible.
A retry shouldn't mean blindly repeating the original operation. Ideally, the tool should first determine whether the previous attempt actually completed, then decide whether another execution is safe.
That's especially important when an agent loses the response after a successful operation. From its perspective, the request failed, but the external system may have already processed it.
Idempotency helps, but I think the real goal is making the tool reliable even when the agent has incomplete information about what happened.
The lost response case is the nasty one. A payment API times out, the agent thinks it failed, but the charge already went through on the other end. "Check before you retry" covers that, and blind retries are exactly what turn one bug into a customer complaint.
Exactly. A timeout tells you that the caller didn't receive a response, not that the operation failed. That's an important distinction, especially with payments or any action that can't safely be repeated.
I'd make the recovery path explicit: check the operation's status using an idempotency key or transaction reference before deciding whether to retry. If the result is still ambiguous, stop and escalate rather than guess. An agent should be able to recover from uncertainty without turning it into a duplicate action.
Splitting this across two boundaries works best in practice:
{ "success": true }. The server owns domain invariants.I really like this split. The MCP server should guarantee that the operation respects the domain rules, while the orchestrator should make sure the intended outcome actually happened across the whole workflow.
The read receipts are an especially good idea. A successful tool call is easy to log, but having independent evidence of the resulting state makes debugging partial failures much less ambiguous. It also creates a useful audit trail when something goes wrong several steps later.
Basically, trust the server to enforce the rules, but never let the workflow confuse a successful response with a completed outcome.
A tool that returns success is a local signal. The only signal the user cares about is the workflow goal, so check the end state.
Exactly. A successful tool response only tells us that an operation completed, not that it produced the intended outcome. The distinction becomes especially important in agentic workflows, where several individually successful steps can still lead to an incorrect final state. I think end-state verification should be treated as a first-class part of the workflow, not an optional check after execution. The real definition of success is whether the user's goal was actually achieved.