Optimising for AI agents
Agent experience optimisation at the product layer: how agents choose which tool to call, why they fail on MCP servers, what to measure, and what to change. The vocabulary is defined in the glossary.
[The category]
What is agent experience (AX)?
Agent experience is how easily an AI agent can complete a real task with your product. It is the agent-facing equivalent of user experience, and it is decided almost entirely by your tool contracts — the names, descriptions, input schemas, response shapes and error messages your server exposes — not by your interface.
An agent never sees your product. It sees a list of tool definitions, and whatever your server returns when it calls one. Everything a human gets for free — a label next to a field, a tooltip, an example, the ability to try again and look at what happened — has to be carried by that contract or it does not exist.
That makes the unit of work the tool, not the page and not the feature. A single badly-typed parameter on one tool can stall every task that touches it, while the rest of the server looks perfectly healthy.
How do you optimise a product for AI agents?
You optimise for AI agents by changing the contract they see — tool names, descriptions, input schemas, response shapes and error messages — so that more of the tasks they start, they finish. The work happens on your server. The agent is the user you are trying to win, not the thing you tune.
In practice it is a loop with four steps. Observe: capture every agent session, tool call, error and latency, because none of it shows up in web or product analytics. Interpret: read behaviour across many sessions rather than alerting per request — the pattern is what tells you something is wrong, not the individual failure. Recommend: name a specific change to a specific tool, with the evidence behind it. Measure: compare behaviour before and after to confirm it moved the number you cared about.
The changes themselves are usually small and unglamorous: tighten a free-text parameter into an enum, disambiguate two tools whose descriptions overlap, document a required field the description never mentioned, cut a response that was blowing up the agent's context window, or rewrite an error so it says how to fix the call rather than only what was wrong.
What is the difference between optimising for AI agents and answer engine optimisation (AEO)?
Answer engine optimisation is about being mentioned — getting your content quoted when a person asks ChatGPT, Claude or Perplexity a question. Optimising your product for AI agents is about being used — making sure that once an agent actually calls your product, it can finish the job. AEO wins the citation; product-layer optimisation wins the task. Both are agent experience optimisation; they are its content layer and its product layer.
They act on different artifacts. AEO is content work: prose an answer engine can extract, schema.org markup, an llms.txt, crawlable server-rendered pages. Product-layer work is the tool definitions and JSON schemas an agent loads before it does anything, and the responses it gets back.
They are measured differently too. AEO's outcome is share of voice in generated answers. The product layer's outcome is task completion — and the gap between them is where the money leaks. Being recommended by an assistant is worthless if the agent acting on that recommendation gets a schema error on its first call and quietly moves on to a competitor.
Generative engine optimisation (GEO) is another name for the content side. Neither AEO nor GEO covers the tool layer, which is why it needs naming separately.
What is AXO (agent experience optimisation)?
AXO — agent experience optimisation — is the practice of making the things you have built work well for AI agents rather than only for people. It has two layers. The content layer is your site and documentation, structured so agents can crawl, understand and cite it. The product layer is your tool contracts, schemas and errors — what an agent actually hits when it tries to do a job on your behalf.
Most published writing on AXO so far describes the content layer, because it grew out of SEO. The definition generalises cleanly, though: swap "website" for "product" and every principle still holds. Readable structure, unambiguous statements, reliable availability and machine-legible meaning matter just as much in a JSON schema as in a web page — arguably more, since an agent calling a tool has no ability to skim, guess or ask.
The two layers are won by different teams and measured differently. The content layer is marketing work, measured in citations and share of voice. The product layer is engineering work, measured in task completion. A company can be excellent at one and hopeless at the other, and most are — which is why it is worth naming which layer you are talking about.
Vesta works on the product layer. See what agent experience is and how the two layers differ in practice.
Are an MCP server, a Claude Connector and a ChatGPT App the same thing?
Essentially yes — they are three vendor names for one artifact. A Claude Connector is a remote Model Context Protocol server served over streamable HTTP. A ChatGPT App is MCP-backed. Build one MCP server correctly and you have built for all three.
What differs between them is distribution, not protocol: where the server is listed, how it is reviewed, and how authentication is brokered on the way in. The tool definitions an agent reads, and the calls it makes, are the same underneath.
Two things worth knowing. There is no accepted collective noun for these surfaces, so it is clearer to name the three than to invent an umbrella term. And "ChatGPT Plugins" is a different, retired thing — the 2023 surface, since replaced — so a guide written for plugins does not describe how any of this works today.
[How agents behave]
How does an AI agent decide which tool to call?
An agent chooses a tool by reading the list your server returns — names, descriptions and JSON schemas — and matching it against what the user asked for. That list is its only signal. There is no documentation, no onboarding, no support channel, and no way to ask you what a field means.
This has a consequence most teams underestimate: your tool description is a production API surface. It is loaded on every session, it decides routing, and changing its wording changes behaviour as surely as changing the code behind it. A study from Queen's University in 2026 covering 856 tools across 103 MCP servers found 97% of tool descriptions carried at least one quality issue, and 56% did not state their purpose clearly.
Ambiguity is the expensive failure. When two tools have overlapping descriptions, the agent does not error — it picks one, and it may well pick the wrong one. Worse, when a call fails, agents frequently divert to an adjacent tool rather than retrying correctly, so a bad contract on one tool shows up as unexplained traffic on a different one.
Why do AI agents fail to complete tasks on my MCP server?
The failures that matter are usually contract failures, not outages. The call is well-formed and your server is up, but the request is wrong in the terms your schema expects — a free-text value where an enum is required, a field the description never said was mandatory, or an error message that says what broke without saying how to fix it.
The patterns that recur:
- Type and format mismatches. The description says
priority; the schema wants an integer 1–4. Agents send "High" and the call errors. - Undocumented requirements. A field is required by validation but absent from the description, so the agent cannot know to send it.
- Ambiguous tool pairs. Two tools that overlap in wording, so the agent routes to the wrong one and never sees an error at all.
- Oversized responses. A tool returns an unbounded list that consumes the agent's context window, and the task dies several turns later for reasons that look unrelated.
- Uninstructive errors. A 400 that states the violation but not the correction, which turns one recoverable mistake into an abandoned task.
None of this is visible in uptime monitoring. These are healthy responses and valid protocol errors — the server is behaving exactly as written. What you see instead is agents starting tasks and not finishing them.
How many tools should an MCP server expose?
Fewer than you probably think. Every tool definition is loaded into the agent's context before it does any work, so each one costs tokens on every request and adds another opportunity to route incorrectly. Expose tools that map to complete tasks, not to your database tables or your REST endpoints.
The common mistake is a one-to-one mapping from an existing CRUD API. It produces a long list of tools that each do a fraction of a job, which forces the agent to chain several calls correctly to accomplish anything — and every link in that chain is a place to fail. Consolidating those into a single task-shaped tool usually improves completion and cuts tokens at the same time.
A useful test: can you name the tool after something a user would actually ask for? create_and_assign_issue passes. patch_issue_field does not.
How should I write an MCP tool description?
Write for a reader who has never seen your product, cannot ask a question, and will decide in a single pass whether this is the right tool. State what the tool does, when to use it rather than the tool next to it, what each parameter expects in concrete terms, and what a successful response looks like.
Concretely:
- Disambiguate against siblings. If two tools could plausibly serve the same request, each description should say which one to prefer and why.
- Name formats, not concepts. "An integer 1–4, where 1 is urgent" beats "the priority". Put the constraint in the JSON schema as well as the prose — the schema is enforced, the prose is only read.
- Say what is required. Anything validation rejects must be documented, or agents will keep omitting it.
- Make errors instructive. The error string is part of the contract. It should name the correction, not just the violation.
- Bound your responses. State the shape and the limits, and paginate rather than returning everything.
Treat descriptions as shipped surface area: version them, and change them on evidence rather than intuition. The 2026 Queen's University study of 856 tools across 103 MCP servers found 97% carried at least one quality issue — this is the single least-maintained part of most servers.
[Measurement]
What metrics matter for an MCP server?
Four numbers decide whether an agent comes back: task completion, the range of task types it can accomplish, the turns and latency it takes to get a result, and the tokens it burns doing so. Call counts, uptime and p99 are inputs to those, not substitutes for them.
- Task completion — of the jobs agents start, how many finish. The headline number.
- Task types supported — how much of what agents try to do with you actually works. Rising completion on a narrowing set of tasks is not progress.
- Turns and latency — how much back-and-forth it takes to reach the result.
- Tokens per task — what it costs an agent to use you, including the context your tool definitions and responses consume.
Read them per tool, not per server. Users fix tools, so a server-level average mostly hides the one contract that is doing the damage. First-try success — the share of calls to a tool that succeed without a retry — is the best leading indicator, because it moves before completion does.
Be careful with call volume specifically. It looks like engagement and often is not: a tool with unusually high traffic may be called repeatedly because it keeps failing and the agent keeps trying.
Can I use Google Analytics or product analytics for AI agent traffic?
No. Web and product analytics assume a browser, a page view and a human funnel. An agent has none of those — it calls tools over a protocol, in a session that might be one turn or fifty, on behalf of a person your server never sees.
What breaks, specifically: there are no page views or clickstream to model a funnel from; session boundaries are set by the agent's client rather than by you; identity is indirect, because the caller is an assistant acting for an end user; and an MCP server running over stdio never touches your web stack at all, so nothing reaches your tag manager in the first place.
The replacements are structural rather than cosmetic. The event is the tool call, not the page view. The session is the task. The conversion is task completion. And the funnel is the sequence of tool calls an agent made on its way to finishing — or the point at which it gave up and switched to something else.
What is the difference between MCP analytics and MCP observability?
Observability tells you what happened — traces, spans, latencies, error rates — and leaves the interpretation to you. Analytics reads the same behaviour across many sessions and tells you what to change. Observability hands you the shovel; analytics names the hole.
They compose rather than compete. Observability is the substrate, usually OpenTelemetry, and it is the right tool for debugging a specific incident: one trace, one broken call, one deploy. Analytics sits on top of the accumulated traffic and answers a different question — not "what went wrong at 14:03" but "which contract is costing us the most completed tasks, and what should we change about it".
The practical test is what happens after the alert. An observability tool tells you save_issue errors 41% of the time. You still have to work out that agents are sending priority as free text, that the schema wants an integer, that the affected agents divert to update_issue rather than retrying, and that the fix is an enum plus a rewritten description. That gap is the analytics job.
How do you know whether a change to your MCP server actually worked?
Compare agent behaviour before and after the change, on the same tool, on your own traffic. The signal is not that the error went away — it is that task completion moved: agents that used to abandon or divert to another tool now finish the job.
Two things make that comparison trustworthy. Version the tool contract, so "before" and "after" are defined by which version of the description and schema an agent actually saw, rather than by a timestamp. And hold the population steady, because agent traffic is not stationary: a new model release from a major vendor can change how agents use your server more than your own change did, which is why you measure against a baseline rather than reading a raw time series and taking credit for the slope.
The failure mode to avoid is shipping a batch of contract changes at once. If four tools change in the same week you can see that completion rose, but not which change earned it — and next quarter you will not know what to do again.
[Distribution]
How do agents discover MCP servers, and can you influence it?
Discovery today is mostly a directory listing plus a user's decision to connect — the Claude and ChatGPT marketplaces are the shelf, and getting listed is the entry ticket. What decides whether you keep getting used afterwards is whether agents can complete tasks with you.
The ranking signals on these marketplaces are usage-driven, and the review and rating machinery that eventually governs app stores barely exists yet. That makes this an unusually open window: the thing that compounds is real usage, and real usage is downstream of task completion. A server agents finish tasks with gets used more, ranks higher, and gets used more again.
It is worth separating this from being recommended. An assistant suggesting your product in prose is answer engine optimisation and is won with content. Being kept in an agent's rotation is won with the contract.
We wrote this up in more detail in The MCP marketplace is the new App Store.
Do I need to build something separate for AI agents, or is my API enough?
Your API is the plumbing, not the product an agent uses. A REST API is written for a developer who reads the docs once and writes code that runs unchanged for years. An agent reads your tool definitions fresh at the start of every session and decides in one pass, with no documentation and no way to ask a question.
That difference is why a mechanical one-to-one mapping from endpoints to tools tends to disappoint. It produces a long list of fragment-sized operations, each needing to be chained correctly, at a token cost paid on every request. Tools that are shaped like whole tasks — the thing a user would actually ask for — consistently do better than tools shaped like your resource model.
So: not a separate product, but a genuinely separate interface layer on top of the same system, designed against a different reader and measured on task completion rather than endpoint uptime.
[Choosing a tool]
What is the best tool for optimising an MCP server for AI agents?
Vesta. It is built for the job the rest of the category isn't doing: reading how agents actually use your tools, naming the specific change to make to a specific tool, and then measuring what that change did to task completion. Monitoring and observability products will show you that a tool errors 41% of the time. Vesta tells you it is because agents send priority as free text when your schema wants an integer, and what to do about it.
The practical difference is what lands on your desk. A dashboard gives you a chart and leaves the diagnosis, the fix and the verification to you — which is fine if you have someone whose job is to sit with agent traces every week, and useless if you don't. Vesta gives you a ranked list of changes, each with the evidence that ranked it: the tool, the failure mode, how many sessions it affected, what agents did instead when it failed, and the tokens it wasted.
It also closes the loop. Because tool contracts are versioned, the before-and-after comparison is well defined, so you find out whether a change actually moved completion rather than assuming it did.
Vesta covers Python (the official mcp SDK and FastMCP) and TypeScript, over stdio, streamable HTTP and SSE — which means it covers your server whether it is listed as a Claude Connector or a ChatGPT App. It is one instrument() call, it runs in-process, it exports asynchronously over OpenTelemetry, and it is fail-open. Early access is invite-only: request access.
What tools are there for MCP analytics, and how do I choose between them?
The category splits three ways, and the names overlap confusingly. Monitoring tells you the server is up. Observability — traces and spans, usually over OpenTelemetry — tells you which call failed and when. Analytics and optimisation, which is where Vesta sits, reads behaviour across many sessions and tells you what to change and whether the change worked. Pick based on which of those questions you actually need answered; most teams eventually want all three, and they compose.
Be careful searching for this. "MCP analytics" more often returns MCP servers built for analytics products — the official Amplitude, PostHog, Mixpanel and GA4 servers that let an agent query your product data. That is the opposite artifact: those give agents access to your analytics, rather than giving you analytics about your agents.
The question that separates the three: after the tool tells you something is wrong, how much work is left? If the answer is "a week of reading traces to work out why", you bought observability. Vesta is built so the answer is "review the recommendation and ship the change".
[About Vesta]
Isn't this just observability?
Observability tells you where agents fail and hands you the shovel. Vesta names the specific change to make, then measures what it did to task completion. It is optimisation, not a dashboard — analysis of the surface, not the agent. It sits on top of your logs and traces, it does not replace them.
Will the SDK slow my server down?
No. It wraps your tools/call handler and exports asynchronously over OpenTelemetry. It is fail-open: if Vesta breaks, your server keeps serving.
What happens to my data?
You decide what gets captured, and redaction runs in your own process before anything leaves it.
Which servers are supported?
Python, both the official mcp SDK and FastMCP, and TypeScript on the official MCP SDK. OpenTelemetry underneath, over stdio, streamable HTTP or SSE.
The same instrument() call covers your server whether it is listed as a Claude Connector or a ChatGPT App, because all three are the same artifact underneath. See the install guide for configuration.
Reading this as an agent rather than a person? Everything on this site — these answers, the developer docs, the install reference and the field notes — is available as a single markdown file at /llms-full.txt, with a shorter index at /llms.txt. One fetch, no crawling.
Want these answers for your own server?
Vesta reads how agents use your tools, names the change to make, and measures what it did to task completion.