Your integration tests pass. Every tool returns what it should, schemas validate, errors are structured.

The agent still spent forty tool calls going in a circle and then confidently reported a result it had not verified.

Nothing was broken. The connector did its job perfectly; the job was just much smaller than anyone assumed.

What the protocol owns

Discovery, invocation, schemas, transport, session lifecycle. Whether a capability exists, how it is described, and how a call is made and answered.

For remote servers it also defines an authorisation flow, and it carries utilities such as progress, cancellation and logging. Nothing on that list decides what the agent should do. It is a contract about plumbing, and it is a good contract.

What the host still owns

Everything that determines whether the system behaves sensibly:

  • The goal, and a checkable definition of what finishing means
  • Budgets: tokens, time, money, number of tool calls
  • Stop conditions, including the ugly ones like "the last three attempts produced the same error"
  • Approval gates for anything expensive or irreversible
  • Policy, meaning what this particular user is allowed to have done on their behalf

None of that belongs in the MCP server. A server enforcing your product's per-user policy is a server that has to know about your product's permission model, which means every consumer of it inherits your assumptions. Data access is different, because the server, or the system behind it, still checks the delegated user's permissions on every call, so a mistake in the host cannot widen what that user can read.

The temptation is to push these rules into prompts, because prompts are easy to edit. A prompt that says "always ask before deleting" is a preference. Product code that refuses to delete without a confirmation is a control. Only one of them survives a model that is having a bad day.

The test that separates the two

Ask what a passing test actually proves.

"The search tool returns results" proves the connector works. "The agent, given an ambiguous request, searched twice, found nothing conclusive, and said so instead of inventing an answer" proves the system works.

The second kind requires evaluating trajectories, meaning what the agent did, in what order, and when it stopped. It is more work to build, and it is the only thing that tells you whether autonomy is safe here. Runs of the same request can take different paths, so assert on properties across several runs (stayed in budget, never reported an unchecked result) rather than on an exact call sequence a model upgrade can change.

Test the loop first

Give the agent a task where one tool returns the same error on every call, and watch what ends the run. If it is the model deciding to stop, rather than a stop condition in host code, you have a preference where you need a control. Widen what the agent may do only once that case, and each failure you are worried about, sits in a trajectory suite the host team owns.

Part 4 of 5 Days of MCP for Production AI.

About this explainer

Format
Explainer
Level
Practitioner
Read
2 min read
Published
Jul 27, 2026

Short mental models: one idea, why it matters, what to do about it.