WebMCP evals
A WebMCP eval is a task in your users' words ("Add the black jacket in medium to my cart"), given to an agent in a real browser on one of your pages. The agent sees the tools the page registers, just as a browser's assistant would, and calls them for real. Your tool's own execute runs, so the cart really changes, and the page shows it. Then three things decide the result:
- The calls: the tools it had to call (with the arguments that matter), the ones it mustn't, and the call budget.
- The page: checks of what the page shows once the agent is done (a cart badge reads 1, an item is listed).
- The judge: it reads every call, the answer and the page at the end, scores the run, and says what went wrong. Each problem is put down to your tools (a misleading description, a loose schema, an unhelpful error, a page that didn't update) or to the agent, with a concrete fix.
Evals are on the website's Evals page, which appears once the site reports WebMCP tools.
Add evals
Suggest evals drafts a few from your tools and the last month of agent sessions, each opening the page where agents actually use those tools. You can also Import an evals.json or simulations.json (see below), turn a real session into one (Turn into an eval on any WebMCP session), or write one with New eval.
Run them
Run all, or Run now on one eval. Each agent (Claude, ChatGPT, Gemini) runs the task in a fresh browser, in a minute or two. Smoke test checks, for free, that the tools are there and that the expected calls work, with no AI involved. Evals can also run every day, whenever your tool list changes, or on every release (with the GitHub integration, against each pull request's preview).
What an eval checks
| Field | |
|---|---|
| Page | Where the browser opens: a path on your site, or a full URL (staging, say) |
| The agent is asked | The task, in a user's words |
| A simulated user | Instead of one message, an AI plays your user from a scenario ("You're buying a gift for your sister, who runs. Around $120"), answering the agent's questions for up to a set number of exchanges |
| A good result | One point a line. The judge marks each met or not |
| Then the page shows | Checks of the page at the end: a selector is or isn't there, how many match, its text, an attribute. Values can be matchers (below). All must pass |
| Must call / must not call | Tools the agent has to call (optionally in order), and tools it mustn't. Forbidden tools never run in the test |
| Expected calls | The exact calls a correct run makes, with the arguments that matter (see below) |
| Setup | Calls run before the agent starts, to set the scene: an item already in the cart, a filter applied. They aren't credited to the agent, and a failing one makes the run inconclusive |
| Runs per agent | Models vary from run to run: run it 3–5 times to see how reliable it is (flaky in alerts when some pass and some don't) |
| When a tool asks to confirm | What the user answers when a tool calls requestUserInteraction: agrees or declines |
| Pass score | Out of 100, from the judge. 0 lets the checks decide alone |
A run passes when every check passes and the judge's score reaches the pass score. It's inconclusive when it couldn't run: the page didn't load, bot protection blocked it, or a setup call failed.
Expected calls
Expected calls use the format of Chrome's webmcp-evals, so a suite behaves the same here and there:
[
{ "unordered": [
{ "functionName": "set_pizza_style", "arguments": { "style": "Pesto" } },
{ "functionName": "set_pizza_size", "arguments": { "size": "Small" } }
] },
{ "functionName": "get_price", "optional": true },
{ "functionName": "search_products", "arguments": { "query": { "$contains": "shoe" }, "maxPrice": { "$lte": 120 } } },
{ "functionName": "add_to_cart", "result": { "ok": true } }
]
- Arguments match as a subset: list only the ones that matter. Arrays match element by element.
- Matchers:
$contains,$pattern(a regex,(?i)for case-insensitive),$gt$gte$lt$lte,$type(string,number,boolean,array,object,null),$any(present, any value). unorderedgroups match in any order;optionalcalls count when made and are skipped when not;resultchecks what the tool returned.- Nothing else makes the list the whole conversation, as webmcp-evals grades it: any other call fails the eval. Off (the default), the agent may also look things up along the way. With
[]and Nothing else, the agent should call no tool at all.
How the browser runs your page
Each run opens your page in a fresh headless Chromium with no cookies or storage. Before your scripts run, the eval browser provides document.modelContext (and the older navigator.modelContext), so it reads every tool you register with registerTool or provideContext, and every <form toolname>. Form tools are filled in and submitted when the form has toolautosubmit or the user is set to agree. A submission that navigates gives the agent the page it lands on, with its JSON-LD. Console errors raised while a tool runs are recorded with that call.
- Your analytics stay clean: requests to AgentStats' ingest are answered by the eval browser itself, so test runs never show up as agent sessions.
- Bot protection: eval traffic sends a user agent ending in
AgentStatsEval/1.0 (+https://agentstats.io/docs/browser-sdk/evals). If Cloudflare or a WAF answers 403 or 503, allow that user agent, or point the eval at a staging URL. - Real effects: tools really run. Keep evals to tasks that are safe to repeat (search, a cart, a draft), put destructive tools under Must not call, or run them against staging.
A run's page
- Problems, each attributed to your tools, the agent, or the setup, and sorted into what to change: the tool's name or description (wrong tool), its input schema (wrong arguments), what it depends on (wrong order), what it returns (result or error), or the outcome. Copy prompt for your coding agent gives Claude Code or Cursor what it needs.
- Setup calls and what they returned, then every tool call in order with its arguments, what came back, and any console errors.
- Conversation, when a simulated user took part, or the final answer.
- The page at the end: its URL and title, each page check with what was actually found, and the console errors.
Import and export
Import takes an evals.json or simulations.json from webmcp-evals or playwright-webmcp:
- An
evals.jsoncase becomes an eval with its expected calls graded strictly (Nothing else), and the checks alone decide the result, as there; the judge still explains failures. Function calls earlier inmessagesbecome setup. - A
simulations.jsoncase brings itsuserMessageoruserScenario,maxTurns,setup,assertions(as page checks) andsuccessCriteria(as the rubric).
Export gives back both files, so you can run the same suites with npx webmcp-evals browser or simulate in your own CI.
From your coding agent or CI
The MCP server has list_evals, run_evals and get_eval_run, with "source": "web". In CI, run against a preview deploy with base_url: each eval keeps its page's path on that host.
curl -X POST https://agentstats.io/api/v1/sites/<site id>/evals/run \
-H "Authorization: Bearer al_sk_…" -H "Content-Type: application/json" \
-d '{ "source": "web", "base_url": "https://pr-42.example.vercel.app" }'
# → { "runs": [{ "id": "run_…", "agent": "claude", "attempt": 1, "status": "queued" }, …] }
curl https://agentstats.io/api/v1/sites/<site id>/evals/runs/run_… -H "Authorization: Bearer al_sk_…"
# → { "status": "done", "verdict": "passed", "score": 92, "checks": [ … ], "problems": [ … ] }
Limits
Each run is one agent's attempt at one eval, judged; repeats count as runs. Plans include 10 (Hobby), 60 (Starter), 300 (Growth) or 1,500 (Scale) runs a month for the whole team. Smoke tests are free.