Web Widgets

Booking by AI agents

The loader also registers booking tools for AI agents running in the visitor's browser (Chrome's WebMCP), so an assistant such as ChatGPT can book an appointment on the visitor's behalf without touching your page's form.

<head>
  <script src="https://cdn.onepath.ai/loader.js"></script>
</head>

That is the whole integration. There is no separate script, attribute, or trigger: when the Web switch is on for your account, the loader registers the tools on every page where it runs and the agent finds them on its own. Nothing is rendered; visitors without an AI agent see no difference.

It turns on with the Web switch

Agent booking shares the Web switch and the Allowed websites list with the scheduler and chat. Turning the switch on under Account settings → Lead Capture → Channels enables all three on every listed domain. There is no separate on/off for agents. Channels

Requirements

  • Browser: Chrome 150 or newer with WebMCP, which exposes tools on document.modelContext. Other browsers ignore the tools; the scheduler and chat keep working as usual.
  • Domain: the page's domain must be on the account's Allowed websites list, exactly like the other widgets.
  • Services: the agent can only book services that are switched on under Services, within your Service Areas, on slots your field service software offers.

What the agent can do

The tools mirror the scheduler's steps. Bookings land in OnePath and in your field service software the same way a scheduler booking does, and your Notifications and webhooks fire for them.

ToolWhat it does
get_booking_statusReads where the session stands (customer, service, slots, appointment) and the next step. Called first when the agent reloads the page.
identify_customerRecords the customer's full name and phone number (email optional). A phone number already in your records is recognized.
describe_service_needPicks the service from your service list, either by exact service names or from the customer's own words, and returns the service's qualification questions.
submit_qualification_answersRecords the customer's answers to those questions. Photo questions are not offered to agents.
check_availabilityLists open slots for the confirmed service at the customer's address. Times are in your account's time zone.
check_urgent_availabilityFinds the earliest urgent slot and states the urgent or after-hours surcharge.
select_and_bookBooks the slot the customer chose and creates the appointment in your field service software.
book_urgent_appointmentBooks the urgent slot once the customer has acknowledged the surcharge.
view_appointmentReads back an appointment booked in this session.
cancel_appointmentCancels an appointment booked in this session, with the customer's reason, in OnePath and in your field service software.

The agent is told to have the customer pick a slot before booking, not to book the earliest slot on its own, and that proceeding confirms the customer is the property owner or authorized decision-maker. Agent bookings do not include the scheduler's text-message consent checkboxes.

Everything the customer said travels with the booking: the problem description and qualification answers feed the job summary your technicians read, exactly as with the scheduler.

What your team sees

  • The appointment appears under the customer in Customers, and the session appears in Interactions.
  • Appointment emails and webhooks are sent as for any other booking.
  • Your team can tell these bookings apart in the browser event below, which carries source: "web_mcp".

Events

A successful select_and_book or book_urgent_appointment fires the same onepath:webscheduler:appointment_created event the scheduler fires, with one extra field:

document.addEventListener('onepath:webscheduler:appointment_created', (e) => {
  if (e.detail.source === 'web_mcp') {
    // booked by an AI agent through the WebMCP tools
  }
});

onepath:config-ready also reports channels.web_mcp.enabled next to web_scheduler and web_chat. Reference: Events.

Verify it works

  1. Open your page in Chrome 150 or newer with the loader installed and the domain on the allowed list.
  2. In the console, run document.modelContext and confirm it exists; then check window.onepath.config.channels.web_mcp.enabled is true.
  3. Ask a WebMCP-capable assistant to book a service on the page. It should identify the customer, pick the service, offer slots, and book without opening the scheduler.
  4. Confirm the appointment under Customers in OnePath.

Good to know

  • Booking state lives in the session on OnePath's side, not in the page. An agent that reloads the page picks up where it left off by calling get_booking_status.
  • Each tool call waits up to 30 seconds for OnePath and is not retried automatically; the agent sees an error with the next step to take.
  • The agent works from your live service list. Rename or hide a service under Services and the agent sees the change the next time it loads the page.
  • Nothing here sends email. If a customer asks the agent for an emailed confirmation, the agent stores the address on their record instead.

Still stuck?

Reach out in your OnePath Slack channel or email your account manager. Include the page URL and the browser's Chrome version so we can help fast.

Previous
Chat widget
Next
Events