Skip to content

MCP: Tools & scenarios

Part of the MCP integration design. Design proposal, not shipped behaviour.

The owner tools and the deferred poll tools follow the conventions the ai-service established, which booking's public tools follow too, so agents already using the App Suite MCP server find the same shape everywhere.

Conventions

  • Small, composable tools. Each tool does one thing; agents chain them (get page, list slots, book). No "do everything" tool.
  • Structured output. Every tool declares an outputSchema and returns structuredContent; the human-readable text part is a short summary, never the only carrier of data.
  • Domain failures are tool results, not protocol errors. A failed booking, an unknown id, or a closed poll returns isError: true with a structured {code, message} payload from the existing error catalog, so the agent can relay and react. Protocol errors are reserved for malformed requests.
  • Annotations. Tools carry readOnlyHint, destructiveHint, and idempotentHint, so clients can ask their user before destructive calls.
  • Links or ids as input. Every capability parameter accepts either the bare id/token or the full pasted URL (booking page, poll page, manage link). Parsing is strict local string matching against the pollBaseURL/bookingBaseURL shapes; the server never fetches a URL, so the parameter is not a request-forgery vector.
  • Times are dual. Instants are ISO-8601 UTC plus a pre-localized human label in the requested (or page-default) timezone. Agents mishandle timezone arithmetic often enough that the server does the formatting.
  • Untrusted content is marked. Tool descriptions name which output fields are end-user content (see Authentication & threat model).

The public tools booking already serves are catalogued in What an agent can do, with their wire shapes in MCP endpoint.

Owner tools (ai-service MCP)

Scoped narrowly: reading and triage before authoring, no appointment-type creation or editing (see Overview, out of scope), and no pause/unpause or poll reopening (deferred, below). The /v1 routes behind exactly these tools form the frozen subset the ADR-0005 revisit names (see Placement of owner tools).

ToolPurpose
booking_list_appointment_typesThe owner's appointment types with status and share URL
booking_get_appointment_typeOne type in the owner view, including upcoming-booking count
booking_list_bookingsUpcoming or recent bookings for one type, paginated
booking_cancel_bookingOwner-side cancellation by booking id; destructive, triggers the cancellation mail and iMIP update
poll_createNew poll from title, description, location, and a list of slots. The result echoes every slot localized and returns the poll link, so the owner reviews before sharing
poll_listThe owner's polls with status
poll_get_resultsOne poll with slots, voters, and votes, for picking a winner
poll_finalizeClose a poll on a chosen slot; creates the calendar event through the owner's session, best-effort as in the UI

Deferred tools

Worked out but held back; the use-case reasoning is in the Overview. The designs stay here so a later drop starts from them rather than from scratch.

Poll voting (public, UC-03)

ToolParametersReturns
get_pollpoll (URL or poll id)The poll (title, description, location, status), its slots, and its voters with their votes. Other voters' mail addresses are omitted (data minimization, see the threat model).
register_poll_voterpoll, name, mail?, votes? (list of {slotId, vote})The created voter including voterId. The description tells the agent to retain the id for later updates.
update_poll_ballotpoll, voterId, votes, mode (merge, default, or replace), name?The updated ballot.

The REST voter update replaces the entire ballot, which is hostile to an agent holding partial context. update_poll_ballot therefore does the read-modify-write server-side: it loads the current ballot, merges (or replaces, per mode) the supplied votes, preserves the name when omitted, and writes the result. Last write wins, exactly as it does between two browser tabs today. The chaining shape mirrors the booking flow: get_poll, compare slots with the user's calendar, register_poll_voter in one call, update_poll_ballot with mode: merge on a change of mind.

These tools also carry the metrics debt named in MCP endpoint: booking_voters_total and booking_votes_total increment in the route handlers, so the increments move into the service layer before an in-process poll tool can count.

Owner conveniences

  • booking_pause_page / booking_unpause_page: idempotent status switches; deferred with UC-07 until a workflow exists that composes them.
  • poll_reopen: reverses a finalization; an undo for a rare mistake that the UI already covers.

Scenario walk-throughs

UC-09, the receptionist's later call. The caller-facing half runs on the public tools and is described in Receptionist agents. What the owner tools add: on a follow-up call the agent no longer depends on holding the caller's manage link, because booking_list_bookings finds the entry under the owner's authority and booking_cancel_booking cancels it, after the same soft identity check a human receptionist performs ("what name is the appointment under?"). The residual risk of a caller misrepresenting themselves stays with the owner, exactly as with staff.

UC-05, finalize a poll. In the ai-service: poll_get_results → the agent summarizes which slot works for whom → the user picks → poll_finalize. The calendar invitation flow is the same as finalizing in the UI.

UC-03, vote in a poll. get_poll → the agent compares the slots with its user's calendar → register_poll_voter submits name and ballot in one call → update_poll_ballot with mode: merge on a change of mind. The voter id has to survive between conversations for the update path to work, which is the sharpest of the reasons this one is deferred.

UC-08, cross-service. The composability argument for the owner tools living in the ai-service: searchContacts (existing tool) finds the participants, poll_create makes the poll, and the agent mails the link via the existing mail tools. None of that composition needs code; it is what MCP clients do with a shared tool namespace.