agent-tracking

Guides

How do I get analytics for WebMCP tools on my site?

WebMCP tools run inside the visitor's browser, so no server log and no web analytics ever sees a call. Agent Tracking's snippet wraps navigator.modelContext and document.modelContext, watches declarative forms, and records every registration and call: tool name, duration, success or failure, error class and the names of the input keys, never their values. The Tools view then shows what works, what fails and what nobody calls.

By · Updated 2026-09-08

Diesen Guide auf Deutsch lesen

Why nothing else measures this

A WebMCP call is a function call between the assistant and the page. There is no HTTP request to log, no pixel to fire, no server involved. If the page does not report it, it did not happen as far as anyone can tell. The snippet reports it, with the argument key names and never the values.

Nothing to change in your tools

Register tools as the specification says. The snippet wraps registerTool before your code runs and catches declarative forms on submit. Registrations appear in the Tools view within a minute.

await navigator.modelContext.registerTool({
  name: "add_to_cart",
  description: "Add a product to the cart by SKU.",
  inputSchema: { type: "object", properties: { sku: { type: "string" }, qty: { type: "integer" } }, required: ["sku"] },
  execute: async ({ sku, qty }) => { /* your code */ },
});

The questions the Tools view answers

How many calls per tool, per day. What share succeeded and what the top three error messages were. How long a call took on average. Which tools were registered but never called, which usually means a description agents do not understand or a schema they cannot fill. When the manifest at /.well-known/webmcp last changed, and on paid plans an email when it does.

From calls to outcomes

Mark the goal with data-agent-goal or treat a tool as the goal, and the dashboard shows whether the agents that called your tools reached the end. The gap between calls and conversions is the number worth working on.

<button type="submit" data-agent-goal="order_placed">Place order</button>

In short

Does this cover remote MCP servers too?

Not their server-side logs; those have their own. Agent Tracking sees tools called in the page through the browser's model context API and, through the MCP endpoint, lets you read the numbers.

Are argument values recorded?

Never. Only the names of the input keys, so you can see which fields agents send and which they skip.