Skip to content

Page tools and WebMCP

Page tools follow the WebMCP draft standard, and tools you register with the browser work too.

Last updated

WebMCP is a draft web standard, from the W3C Web Machine Learning Community Group, for the tools a website offers to AI agents. Page tools use its names, so the code you write for help.ai also fits a browser's own AI features.

WebMCPIn help.ai
A tool: name, title, description, inputSchema, annotations, executeThe page tool object, unchanged
registerTool(tool, { signal })HelpAI('registerTool'), chat.registerTool(), useHelpAITool()
annotations.consequentialHintThe visitor approves each call first
annotations.readOnlyHint, untrustedContentHintAccepted; not used yet
toolname, tooldescription, toolparamdescription, toolautosubmitA form as a tool

Tools you register with the browser#

In a browser with WebMCP, your page can register tools with the browser itself, through document.modelContext. The widget offers those to the agent too, and runs them through the browser. Forms are the exception: the widget fills toolname forms itself, as in every other browser.

Browsers without WebMCP, which is most of them today, are unaffected: tools registered with the widget work everywhere.

Try it in Chrome#

  1. Open chrome://flags/#enable-experimental-web-platform-features, set it to Enabled and relaunch Chrome.
  2. Open a page with your widget, and in the DevTools console run:
js
document.modelContext.registerTool({
  name: 'check_weather',
  description: "Get today's weather at the store. Use it whenever the visitor asks about the weather.",
  inputSchema: { type: 'object', properties: {} },
  execute: async () => ({ sky: 'sunny', celsius: 21 }),
});
  1. Ask the chat "What's the weather at the store today?" The agent calls check_weather and answers with the result.

When two tools share a name#

The widget reads the browser's WebMCP tools, then your forms, then the widget's tools option, then registerTool. For a name in more than one place, the later one wins.

Was this helpful?

Still need help?

Ask the community