How to test WebMCP on your website with Chrome and ChatGPT
This is the hands on companion to What is WebMCP, and which AI tools actually use it? That post explains what WebMCP is and why it isn't SEO. This one shows how to check whether the WebMCP tools on your site actually work.
I keep it as a separate page because it changes faster. Browser APIs get renamed, ChatGPT's interface moves around, and every time that happens the commands below need a refresh. Everything here is generic; replace example.com and the tool names with your own.
Tested in Chrome with the WebMCP testing flag and in the ChatGPT desktop app. Every update is listed in the changelog.
What you need
- Chrome, version 149 or newer.
- The ChatGPT desktop app, with an account that has site tools, for Part 2.
- A page that registers WebMCP tools. If you don't have one yet, you can follow along on ntegrative.com, which has two read only tools.
Part 1: Test in the Chrome console
The console shows you exactly what an agent would see, without any AI in between. Start here; it is the fastest way to find problems.
Step 1: Enable WebMCP in Chrome
Type chrome://flags/#enable-webmcp-testing in the address bar, set the flag to Enabled and relaunch Chrome.
Step 2: Open the console
- Open the page you want to test.
- Open the console:
Cmd + Option + Jon Mac,Ctrl + Shift + Jon Windows. - Open the console settings (gear icon) and tick Preserve log. Some tools navigate to another page, and without this setting you lose the output.
- The first time you paste code, Chrome may warn you. Type
allow pastingand press Enter.
Each block below runs on its own. Paste it, press Enter. An undefined under a table is normal, not an error.
Step 3: Is WebMCP available?
Chrome console'modelContext' in documentExpected: true. If you see false, the flag isn't active; relaunch Chrome and try again.
Step 4: List all tools on the page
Chrome consoleconst tools = await document.modelContext.getTools();
console.table(tools.map(t => ({
name: t.name,
readOnly: t.annotations?.readOnlyHint ?? false,
description: t.description
})));Read this table the way an agent would. For each tool, ask: from the name and description alone, would I know when to use it? Does it say what it returns? Is a tool that only reads marked as read only?
Do this on a few different page types too (home, a listing, a detail page). If every page shows the exact same list, the tools probably don't reflect what each page is for.
Step 5: Run a read only tool
Chrome consoleconst tools = await document.modelContext.getTools();
const tool = tools.find(t => t.name === 'search_articles');
const result = await document.modelContext.executeTool(tool, { query: 'pricing' });
console.log(result);Pass the arguments as an object, as above. Passing them as a JSON string is deprecated from Chrome 155. If the result is a JSON string, wrap it in JSON.parse() to explore it.
Check the output against the page. Are the URLs canonical? Are the dates right? Does the tool state facts that the page states, such as whether content is free, instead of leaving the agent to guess?
Step 6: Check that "success" means success
Tools that change something on the page (open a tab, apply a filter, navigate) should be tested by comparing what the tool reports with what actually happens:
Chrome consoleconst tools = await document.modelContext.getTools();
const tool = tools.find(t => t.name === 'open_pricing_tab');
const before = location.href;
console.log('Tool says:', await document.modelContext.executeTool(tool, {}));
console.log('URL before:', before, 'URL after:', location.href);Then look at the screen. If the tool says it worked but nothing visibly changed, or the page jumped somewhere unexpected, you have found one of the mistakes in Part 3.
Be careful with tools that write into forms on a live site. Don't run a tool that fills an email or name field, and never submit test data on production.
Step 7: Look for duplicate ids
If your tools find elements by id, duplicate ids will send them to the wrong element. This lists every id that appears more than once:
Chrome consoleconst ids = [...document.querySelectorAll('[id]')].map(e => e.id);
console.table([...new Set(ids.filter((id, i) => ids.indexOf(id) !== i))]);An empty table is what you want.
Part 2: Test with ChatGPT
Once the console looks clean, test with the one agent that uses WebMCP in practice today.
- Open the ChatGPT desktop app and switch to Work mode (Codex also works). Pick a model that supports site tools; in my tests GPT 5.6 Terra and GPT 5.6 Sol did, GPT 5.6 Luna did not.
- Open your site in the app's built in browser. If the page provides tools, an arrow appears in the address bar. Click it to see the list and whether each tool reads or changes information.
- Try prompts like these, one at a time:
List every site tool on https://example.com/. Don't run any of them.Run the search_articles tool on https://example.com/ with the query "pricing" and show me the raw result.Find the three newest articles about pricing on https://example.com/. Afterwards, tell me whether you used site tools or read the pages.After each prompt, open the arrow in the address bar and check recently used. That shows whether ChatGPT really called a tool or quietly fell back to reading the page.
Always write the full URL in your prompt. ChatGPT works in its own browser tab, which you may not see, so "this page" can mean a different page than the one in front of you.
Part 3: The mistakes I see most often
These come up again and again, especially on sites where tools are generated automatically from the page's HTML.
- Ghost tools from hidden menus. A script scans the page, finds links inside a closed menu and turns them into tools. The tool reports success, but nothing happens on screen, because the element was never visible. The agent trusts the report and gives the user a wrong answer. Fix: mark closed menus with
aria-hidden="true"orinert(screen reader users will thank you too), and make the scanning script skip anything hidden. - Duplicate ids. Two elements share an id. The tool takes its name from one and clicks the other, often with a console error, and still reports success. Fix: unique ids, and a scanning script that refuses to build tools for duplicated ids.
- Noise tools. "Close popup", "dismiss notification", "go to homepage". They add nothing an agent needs and make the right tool harder to pick. Remove them.
- Tools that type personal data. A tool that writes into a newsletter or login field lets an agent fill in the user's email. Leave those out entirely.
- Missing
readOnlyHint. If tools that only read aren't marked, the agent has to treat them as risky and may ask the user for permission every time. - No tool for the main job. The site's core task (searching content, finding a product, checking availability) has no tool, so the agent falls back to reading pages, paginating and guessing. This is the most expensive gap and usually the most valuable tool to add.
- The same tools on every page. A generic list that ignores what the page is for. Agents get more out of a few page specific tools.
- Optimistic success messages. A tool returns "done" without checking that anything happened. Return what actually changed, or an honest error.
- Tools that only exist in iframes or as form attributes. Support for these varies. Check in ChatGPT that they are actually picked up, and register in JavaScript on the main page when in doubt.
Part 4: A short checklist
'modelContext' in documentistruewith the flag on.- The tool list is short, and every name and description makes sense to a stranger.
- Every tool that only reads has
readOnlyHint: true. - The site's main task has a dedicated tool.
- No noise tools, no tools from hidden elements, no tools that type personal data.
- No duplicate ids on the page.
- Tool output matches the page content and structured data.
- Success messages are verified, failures are reported.
- ChatGPT's "recently used" view confirms the tools are actually called.
Changelog
- First version.
Sources
- Chrome for Developers: WebMCP
- Chrome for Developers: WebMCP imperative API
- OpenAI: Site tools (developer documentation)
- OpenAI Help Center: Using site tools in the ChatGPT desktop app
If a command here stops working, or you find a mistake that belongs in Part 3, tell me and I'll add it. Write to [email protected] or reach me on LinkedIn.