Skip to content

Guide

Adding an agent to your website for bookings and service selection

Let an agent helping your visitor choose a service or request a booking through your page's own functions, with the visitor confirming anything that matters.

Two different things people mean

Sometimes "an agent on your website" means a chat assistant you add to the page. Sometimes it means making your page usable by the visitor's own agent, the one in their browser helping them book a haircut or compare quotes. This guide covers the second, because it is what WebMCP is for and it is the one most sites are not ready for.

Both depend on the same groundwork: your services, prices, and availability exist as structured information, not only as prose on a page.

Offer a few functions, not the whole site

Under the current WebMCP draft, a page registers tools with document.modelContext.registerTool(). Each tool has a name, a description, an input schema, and a function that runs when the agent calls it. Registration is tied to an abort signal, so the tools disappear when the page no longer wants to offer them.

For a small service business, three tools cover most visits: list the services, check availability for one of them, and request a booking. Each should do one thing and describe exactly what it needs.

const controller = new AbortController();

await document.modelContext.registerTool(
  {
    name: "request_booking",
    title: "Request a booking",
    description:
      "Requests an appointment for one service at a proposed time. " +
      "The business confirms it; this does not create a confirmed booking.",
    inputSchema: {
      type: "object",
      properties: {
        serviceId: { type: "string" },
        preferredTime: { type: "string", description: "ISO 8601 date and time" },
        name: { type: "string" },
        email: { type: "string" },
      },
      required: ["serviceId", "preferredTime", "name", "email"],
    },
    execute: async (input) => submitBookingRequest(input),
  },
  { signal: controller.signal },
);

The visitor confirms; the tool requests

Design every tool that commits to something as a request, not a decision. A booking tool proposes a time and your business confirms it. A quote tool returns a range and a person sends the quote. Payment never happens inside an agent tool without the person seeing the amount and approving it.

Say so in the tool's description. An agent reads it, and so will anyone auditing what happened later.

Browser support is early

WebMCP is a Community Group draft and support in shipping browsers is limited. Registering tools does no harm where the API is missing: feature-detect it, and the page simply works as it always did. The groundwork, structured services and clear booking rules, pays off either way.