agent-tracking

Guides

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

Supported WebMCP calls can be instrumented in the browser; remote MCP calls require server integration. The snippet observes supported model-context APIs and declarative forms, and records safe tool metadata and technical outcomes without raw argument values. Coverage depends on the browser API and installation order.

By · Updated 2026-09-08

Diesen Guide auf Deutsch lesen

Why instrumentation matters

A browser-local WebMCP call may not create a separate server request. A site can send its own analytics event for it; Agent Tracking observes supported APIs when the snippet is installed in time. It does not capture raw argument values.

Install before tool registration

Load the snippet before supported tool registration so it can observe registrations and calls. Declarative forms require supported markup and browser behavior. Check the Tools view after an actual call rather than assuming complete coverage.

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 observed calls occurred per tool and day, their technical success or failure and duration. A registered tool with no observed calls may be unused, or its activity may be outside the instrumented context. Errors are safe classes rather than raw messages.

From calls to outcomes

A data-agent-goal marker records a browser attempt. A site-server outcome endpoint records a confirmed business event. Read both separately unless your own workflow links the specific call and receipt.

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

In short

Does this cover remote MCP servers too?

Yes, through the separate authenticated server-tool endpoint. The browser snippet does not see remote calls; the MCP read endpoint exposes reported metrics, not hidden remote executions.

Are argument values recorded?

No raw argument values are retained. The supported browser event records safe metadata such as tool name and technical outcome; check the event schema for exact fields.