DEV Community

Oleksandr
Oleksandr

Posted on Edited on

The MCP Tool Worked. The Workflow Still Failed.

There's something easy to overlook when building AI agents with MCP:

A successful tool call doesn't necessarily mean a successful task.

The server responded.
The tool returned a result.
No exception was raised.

Everything looks fine.

Except the agent may have changed the wrong record, acted on outdated information, or completed only half of what the user actually requested.

And that's where things get interesting.

A Successful Response Is Not Proof of a Correct Outcome

Imagine an AI agent is asked to upgrade a customer's subscription.

It calls an MCP tool:

{
  "tool": "update_subscription",
  "arguments": {
    "customer_id": "cus_123",
    "plan": "pro"
  }
}
Enter fullscreen mode Exit fullscreen mode

The server responds:

{
  "success": true,
  "status": "updated"
}

Enter fullscreen mode Exit fullscreen mode

The agent reports:

"Subscription successfully upgraded."

But what if:

  • The customer ID was resolved incorrectly?
  • The subscription was already scheduled for cancellation?
  • The update changed the plan but not the billing configuration?
  • Another process modified the subscription between the initial read and the update?
  • The response confirms that the request was accepted, not that the final state is correct? The tool did exactly what it was designed to do.

The workflow still may have failed.

MCP Solves an Important Problem, But Not This One

MCP gives AI applications a standardized way to discover and interact with tools and resources.

That's valuable.

It reduces the need for every integration to invent its own communication pattern.

But interoperability and operational correctness are different problems.

A standardized tool interface doesn't automatically guarantee:

  • Correct interpretation of user intent.
  • Valid assumptions about the current state.
  • Safe execution when conditions change.
  • Verification of the final result.
  • Recovery when a multi-step workflow partially succeeds. In other words, MCP can help an agent communicate with a system. It doesn't automatically make the agent a reliable operator of that system.

I Think We Need to Think in Terms of Execution Contracts

Instead of treating a tool call as a single isolated action, I'd like to see more workflows designed around four explicit stages:

1. Preconditions

What must be true before the action is allowed?

For example, the customer ID must be verified, the subscription must be active, and the requested plan must be available.

2. Execution

What exactly is the tool expected to change?

The operation should have a clearly defined scope, rather than relying on assumptions hidden inside the agent's reasoning.

3. Postconditions

What evidence proves that the intended state was actually reached?

Not just whether the API returned success, but whether a fresh read confirms the expected result.

4. Recovery

What happens if the operation succeeds partially, times out, or produces an ambiguous result?

Should the agent retry, inspect the current state, request human approval, or stop?

This distinction becomes especially important when several MCP tools are chained together.

A workflow can have five individually successful calls and still produce an incorrect final outcome.

The Missing Layer Might Be Verification

Here's the architectural distinction I keep coming back to:

User Intent
    |
    v
AI Agent
    |
    v
MCP Tool Discovery
    |
    v
Precondition Check
    |
    v
Tool Execution
    |
    v
Independent State Verification
    |
    +---- Verified ----> Report Outcome
    |
    +---- Uncertain ---> Investigate / Escalate
    |
    +---- Failed ------> Recovery / Stop

Enter fullscreen mode Exit fullscreen mode

The important part is that verification should not simply repeat the tool's success message.

It should inspect the resulting state independently whenever possible.

For high-impact operations, the agent should also preserve evidence of what it checked, what it changed, and why it considered the result successful.

That creates something much more useful than a conversation transcript: an execution trail that can actually be audited.

One Question Worth Discussing

As MCP adoption grows, I suspect we'll spend less time asking whether an agent can access a tool and more time asking whether we can trust what it does with that access.

A tool returning success: true is a technical response.

A task being completed correctly is an operational guarantee.

Those are not the same thing.

Where do you think responsibility for verification should live: inside each MCP server, in the agent orchestration layer, or in a separate execution and validation layer?

I'm particularly interested in how people are handling this in real multi-tool workflows.

Top comments (1)

Collapse
 
parlup profile image
parlupme •

Splitting this across two boundaries works best in practice:

  1. 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.
  2. 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.