# Let the assistant use your page | Busymate AI

Source: https://busymate.ai/ru/docs/guides/page-tools
Busymate AI already knows what your business says. **Page tools** let your assistant do what your *page* does — look up an order, book a slot, start a return — by calling functions your site already has, in the visitor's own session. You write each action once and it reaches every visitor: through the browser where WebMCP is implemented, and through the assistant's own bridge everywhere else, mobile apps included.

Diagram: Your page registers its actions once; the assistant reaches them through the browser where WebMCP exists and through its own bridge everywhere else

Your assistant is already on the page — the one embed script you added when you set it up. Page tools ride that same script; there is nothing extra to install.

## 1. Decide what the page can do

Pick three to seven things a visitor does here, and note for each whether it only **reads** or actually **changes** something.

| Reads | Changes |
|---|---|
| Look up an order, check stock, show today's slots, filter the list on screen | Book, pay, cancel, submit a form, change an address |

Name each with a verb — `check_order_status`, `list_available_slots`, `start_return` — and describe it the way you would to a new colleague. That description is what the assistant reads to decide when to use it.

## 2. Register them

One call, on the page where those actions live:

{{snippet:page-tools}}

`execute` runs **in your page**, on the visitor's own session. The assistant never receives your cookies, your tokens or your markup — only the value you chose to return.

Mark every read with `annotations: { readOnlyHint: true }`. Anything without that mark counts as a change: the assistant shows the visitor the exact call and waits for a yes. There is no way to switch that off, and no reason to mark a change as a read — the confirmation is what makes a visitor comfortable letting an assistant act at all.

With a bundler, import `registerPageTools` from `/sdk/v1/webmcp/index.js` on your assistant's address instead of using the global.

## 3. Forms you already have

If the action is a real `<form>`, annotate it and register every annotated form on the page with one call to `registerDeclarativeForms()` — no other JavaScript:

{{snippet:page-tools-forms}}

The form keeps working for people exactly as before. Submitting it changes something, so it asks first — unless you add `data-tool-readonly` to a form that only filters what is already on screen.

## 4. Tools that come and go

A tool the visitor cannot currently use should not be offered. Pass `{ signal }` from an `AbortController` and call `abort()` when the view goes away; the tools disappear with it.

## 5. Who can see them

By default your tools are exposed to your assistant's own address and nothing else; any other origin is refused by name. To add one, name it exactly in `exposedTo` — there are no wildcards, because `*.example.com` would hand every subdomain you do not control the right to run your page's actions.

You also keep one switch: **Site page tools**, in the Console under Channels and access. Turning it off stops your assistant using page tools everywhere, without touching your site's code.

## 6. Let a checker see them

The SDK also writes `<link rel="webmcp-catalog" href="…">` into your head, and
rewrites it whenever your tool list changes, so an inspector can confirm the
registration without a console. If your site has a server, serve the same
document at a real URL and put that link in your served head: it is the only
version a reader can see without running your page, and yours is never replaced.

## Verify

1. Open your site with the assistant and press **Site tools** in its header. Every tool you registered is listed with its description and arguments, and the ones you marked read-only say so.
2. Run a read-only tool from that list. The result matches what your page shows for the same thing.
3. Run one that changes something. It asks first and shows the exact call; declining leaves the page untouched.
4. Ask the assistant in plain words to do one of those things — it picks your tool rather than describing a page.
5. Open the same page in Safari or inside your mobile app. The list is identical: the bridge covers what the browser does not.
6. Navigate away from the view you registered on. The tool leaves the list.
7. View the page source with the assistant loaded: a `webmcp-catalog` link is present and its document lists the same tools.

<!-- qa:start -->
### Do I need Chrome for this to work?
No. Where the browser implements WebMCP your tools are registered with the browser itself; everywhere else — Safari, Firefox, and any iOS or Android app WebView — the assistant reaches the same tools over its own bridge. You write them once either way.

### Can the assistant run something without asking?
Only what you marked `readOnlyHint`. Everything else stops at a confirmation showing the exact call and its arguments, and nothing happens until the visitor agrees.

### What can the assistant see?
Only what your `execute` returns. It runs inside your page, so it can reach whatever your page can — and the assistant gets the value you hand back, never your session, your storage or your markup. Whatever a tool returns is treated as content from your site rather than as instructions, so text on your page cannot redirect the assistant.

### Can another site use my tools?
No. Tools are exposed to an exact list of origins — your assistant's address by default — and a call from anywhere else is refused by name, not silently ignored.

### I already wrote the browser API by hand. Do I have to change?
No, it keeps working. The one call registers on that same browser API where it exists and adds the bridge for every visitor whose browser does not have it, so the reason to switch is reach, not correctness.
<!-- qa:end -->

## Next

- **[Connect your MCP server as assistant tools](https://busymate.ai/ru/docs/guides/connect-mcp-server)** — the actions that live on your servers rather than on the page.
- **[Recognize signed-in customers](https://busymate.ai/ru/docs/guides/identified-visitors)** — so a page tool can answer about *this* customer's order.
- **[In-app support for iOS and Android](https://busymate.ai/ru/docs/guides/mobile-in-app-support)** — where the bridge is the only transport.
