Skip to content

sessions_cancel_booking

Previews the refund outcome, then cancels on a second, confirmed call.

Writesign-in required

When to use it

  • First without confirm, to find out what cancelling would refund under your cancellation policy.

  • Then with confirm: true, once the person has seen that outcome and agreed to it.

Parameters

registrationstringrequired

Registration id, as returned by sessions_list_bookings.

confirmbooleanoptional

Omit or false to preview. True only after the person has seen the refund outcome and agreed to it.

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.

Without confirm: the refund decision, the amount, any fee withheld, and whether a pass credit comes back — and nothing is cancelled. With confirm: true: the same outcome, having actually cancelled.

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_cancel_booking',
);

const result = await document.modelContext
  .executeTool(tool, {
    "registration": "<registration id>",
    "confirm": false
  });
content
Nothing has been cancelled. Here is what
cancelling Morning Yoga would do right now:

Refund decision: fullRefund
Money back: 24.00 CAD
A pass session credit comes back.
structuredContent
{
  "cancelled": false,
  "cancellationPreview": {
    "decision": "fullRefund",
    "amount": 2400,
    "restoresPassSession": true,
    "restoresGiftCard": false,
    "penaltyFixedCents": 0,
    "forfeitedCredits": 0
  }
}

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_cancel_booking
Two steps, on purpose. Called without confirm, it returns what cancelling would do under this business’s policy right now — the refund amount, any fee withheld, whether a pass credit comes back. Relay that to the person and get their agreement. Only then call again with confirm: true to actually cancel. Never pass confirm: true on the first call.

See also