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.
Terms in this piece
About this explainer
- Format
- Explainer
- Level
- Practitioner
- Read
- 2 min read
- Published
- Jul 27, 2026
- Disciplines
Short mental models: one idea, why it matters, what to do about it.
More on these topics
Comparison · · 8 min read
Direct APIs, MCP tools and Code Mode: three ways an agent reaches your systems
How I choose between hand-written tools, MCP tool calls and Code Mode by where the plan runs, and why I built codemcp to test it.
Article · · 1 min read
What an AI gateway actually costs to run
The operational bill for one gateway in front of a dozen tool servers, including the costs nobody budgets for.
Deep dive · · 5 min read
One MCP server is an integration. Thirty is why you need a gateway
Notes from building an MCP gateway. The protocol standardised how agents call tools, then stayed silent about credentials, context budgets and who may call what. That silence gets expensive as the servers multiply.
Discussion