All articles
NewsOctober 22, 20267 min read

Google's New WebMCP Tools: webmcp-extension, webmcp-types, and webmcp-skills

The Chrome WebMCP team released three open-source tools: an agent extension for testing your tools, official TypeScript types, and an Agent Skill with Google's rules for tool design. Here's what each one does and what it tells you about how agents will treat your site.

The short version

  • webmcp-extension: a Chrome extension with a side-panel agent that finds a page's WebMCP tools and calls them while you chat with it. Useful to see your tools the way an agent sees them.
  • webmcp-types: TypeScript definitions for document.modelContext. The arguments of execute() are inferred from inputSchema.
  • webmcp-skills: an Agent Skill, build-webmcp-tools, for coding agents. Its reference files are the most concrete public guidance yet on naming, descriptions, error handling, and annotations.

1. webmcp-extension: test your tools with a real agent

Until now, testing WebMCP mostly meant listing tools and calling them by hand, in Chrome's DevTools or the Model Context Tool Inspector. That checks that a tool runs. It doesn't show whether a model picks the right tool for a request, fills in the arguments correctly, or makes sense of what comes back.

The webmcp-extension closes that gap. It opens a side panel with a chat. You type a request like "find me a blue running shoe under $100", and a model decides which of the page's tools to call. The extension runs them on the page and feeds the results back. It reads tools from document.modelContext.getTools() and picks up new ones as they register, including tools in iframes.

It has two backends:

  • Local server (the default): a small Node.js server that talks to Google, OpenAI, Anthropic, or Ollama through the AI SDK. API keys stay on that server.
  • On-device model: Chrome's built-in Prompt API. No server, no API key, and page data stays on your machine. It needs chrome://flags/#prompt-api-tool-use as well.
Setup
# Chrome 155+, with chrome://flags/#enable-webmcp-testing turned on
git clone https://github.com/GoogleChromeLabs/webmcp-extension
cd webmcp-extension
cp .env.example .env      # set MODEL and that provider's API key
npm install
npm run server            # model server on http://localhost:3000
npm run build             # second terminal; writes the extension to dist/

# chrome://extensions -> Developer mode -> Load unpacked -> dist/

Then open the side panel on any page that registers WebMCP tools. Google labels it an example agent, not a production one, but it's the closest thing yet to a reference for how an agent is expected to behave.

Annotations now change what an agent does

The most useful part of the extension is how openly it treats tool annotations. They are hints the page sets when it registers a tool, and the extension acts on each one:

AnnotationWhat the extension does
readOnlyHint: trueRuns without asking the user.
readOnlyHint: false (or unset)Asks first: Allow, Don't allow, or allow on this site for the chat.
consequentialHint: trueAlways asks, even with alerts off and even if the tool also claims to be read-only. No "allow for this chat" option.
untrustedContentHint: trueThe result is encoded or wrapped in a marker before the model sees it, and the model is told to treat it as data, never as instructions.

The practical result: a search tool without readOnlyHint: true asks the user for permission on every call. That's friction a shopper won't sit through. A checkout tool without consequentialHint: true may run after a single "allow for this chat". Annotations used to be nice to have. In this agent they decide whether a tool is pleasant to use.

The extension also has fixed limits: tool results are cut at 8,000 characters, and one request can make at most 100 rounds of tool calls, with a check-in after 10. A tool that returns a full product catalog in one response will be truncated.

2. webmcp-types: official TypeScript definitions

If you write registerTool() calls by hand in TypeScript, this package replaces whatever declare global block you've been keeping. It covers document.modelContext, tool definitions, annotations, getTools(), executeTool(), and the toolchange, toolactivated, and toolcancel events. It needs TypeScript 5.0 or newer.

Install
// npm install --save-dev webmcp-types

// tsconfig.json
{
  "compilerOptions": {
    "types": ["webmcp-types"]
  }
}

The nice part is inference. Write the inputSchema inline and the argument of execute() gets its type from it, including required and optional fields, enums, and nested objects:

Typed from the schema
document.modelContext?.registerTool({
  name: "search_products",
  description: "Searches the catalog by keyword. Use when the user looks for a product.",
  inputSchema: {
    type: "object",
    properties: {
      query: { type: "string" },
      sort:  { enum: ["price", "relevance"] },
    },
    required: ["query"],
  },
  // input is typed as { query: string; sort?: "price" | "relevance" }
  execute: async (input, { signal }) => { /* ... */ },
})

The schema the model sees and the type your code works with now come from the same place, so they can't drift apart.

3. webmcp-skills: Google's rules for good tools

build-webmcp-tools is an Agent Skill. You load it into a coding agent, and it walks the agent through designing, implementing, and auditing WebMCP tools. Even if you never load it, its reference files are worth reading as a style guide. The rules that matter most:

Size budgets

Tool name≤ 30 characters
Parameter name≤ 30 characters
Tool description≤ 500 characters
Parameter description≤ 150 characters
Tool output≤ 1,500 characters (about 400 tokens)

Lists should be paginated rather than dumped. Long single items should come in pages with a continuation signal instead of being cut off silently.

Descriptions: what, then when

Each description says what the tool does and when to pick it over the alternatives, for example: "Searches the product catalog by keyword, category, or brand. Use when locating products or comparing options." Don't repeat parameter names and types, since the model already gets them from inputSchema. Leave out implementation details like Redux, GraphQL, or "mutation handler".

Errors: resolve, don't throw

This one is easy to get wrong. Under the spec, if a native registerTool() handler throws, the agent receives a generic DOMException: UnknownError and your error message is lost. Return a structured error instead, and say whether retrying makes sense:

Actionable error
async execute({ query }, { signal }) {
  const res = await fetch(`/api/search?q=${encodeURIComponent(query)}`, { signal })
  if (!res.ok) {
    // Resolve, don't throw: a throw reaches the agent as "UnknownError"
    return { error: `Search unavailable (${res.status}).`, code: "SERVICE_UNAVAILABLE", retryable: true }
  }
  return await res.json()
}

Accept what the user said

Don't make the model do arithmetic. Accept "next Friday" and resolve the date in your code, rather than requiring an ISO date the model has to calculate. Looking up a standard value is fine, such as "economy" for a cabin class. Prefer names like shipping: "Express" over internal IDs.

Navigation is not read-only

A tool that opens a form or switches views changes client state, so it shouldn't claim readOnlyHint: true. Name it accordingly: start_booking for a tool that opens the booking flow, book_flight for one that books.

The same repository also has webmcp-evals, an experimental CLI that runs test prompts against your tool schemas or a live page and checks which tools a model calls, with which arguments, and in what order.

What this means if you use Aigentably

Tools served by the Aigentably snippet register on document.modelContext like any other, so they show up in the extension without extra setup. A few of the rules above are already handled for you:

  • Annotations on every tool. Each tool carries readOnlyHint, consequentialHint, and untrustedContentHint. They are inferred from the tool's name and description unless you set them yourself in the tool editor.
  • Errors are returned, not thrown. When a tool's code fails, the snippet catches the error and gives the agent the message, so it never sees a bare UnknownError.
  • Titles and exposedTo are passed through when they're set.

The design rules for descriptions, output size, and naming apply to generated tools just as much as to hand-written ones. We're checking our generator and snippet against Google's guidance and will note changes in the changelog.

Further reading

Related

Get tools worth testing

Generate WebMCP tools from your URL, with annotations set, then try them in the extension.

Get started free