Skip to content

sessions_list_bookings

The viewer’s own bookings, upcoming or past.

Viewerread-onlysign-in required

When to use it

  • When the person asks what they have booked.

  • To get the registration id sessions_cancel_booking needs.

Parameters

whenstringoptional

Which registrations to return. Default "upcoming".

One of: upcoming, past, all

limitnumberoptional

Maximum registrations to return. Default 25, maximum 100.

Returns

Every tool returns two things: text for the model to read, and a structuredContent object beside it for code that would rather branch on a field.

One line per registration: the session name, the registration id, its status, and the session’s time. Defaults to upcoming; pass when for past or all.

Example

Run this from any agent or script executing in the page.

javascript
const tools =
  await document.modelContext.getTools();

const tool = tools.find(
  (t) => t.name === 'sessions_list_bookings',
);

const result = await document.modelContext
  .executeTool(tool, {
    "when": "upcoming",
    "limit": 10
  });
content
2 of 2 upcoming registration(s):
- Morning Yoga [reg <id>] · registered ·
  2026-09-02T09:00 → 2026-09-02T10:00
structuredContent
{
  "registrations": [
    {
      "id": "<id>",
      "status": "registered",
      "activitySession": {
        "id": "<id>",
        "name": "Morning Yoga",
        "startAt": "2026-09-02T09:00:00.000Z"
      },
      "cancellationPreview": {
        "decision": "fullRefund",
        "amount": 2400
      }
    }
  ]
}

What the agent is told

The description the model reads when deciding whether to call this. It is the only thing that decides whether the tool fires at the right moment, so it is worth knowing what it says.

sessions_list_bookings
The signed-in viewer’s own registrations with this business — upcoming by default. Each carries a registration id you can pass to sessions_cancel_booking.

See also