sessions_preview_checkout
Real totals for a booking — subtotal, discount, tax, credit, amount due.
When to use it
Before the agent quotes any figure — this is the only tool that returns real money.
Always before
sessions_book_session: an amount due of zero is what makes that tool usable at all.To test whether a discount code, gift card, or a pass the person holds actually covers a session.
Parameters
sessionstringrequiredThe scheduled session id, as returned by sessions_list_schedule. Pass it through verbatim — it is an opaque global id, not a number.
discountCodestringoptionalDiscount code to apply.
giftCardCodestringoptionalGift-card code to apply.
passstringoptionalId of a pass or membership the viewer holds, to cover the seat. From sessions_list_purchases.
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.
The full breakdown — subtotal, discount, tax, gift-card credit, total, and amount due — plus an explicit line saying whether the booking can be completed by an agent or has to go to the sheet.
Example
Run this from any agent or script executing in the page.
const tools =
await document.modelContext.getTools();
const tool = tools.find(
(t) => t.name === 'sessions_preview_checkout',
);
const result = await document.modelContext
.executeTool(tool, {
"session": "<session id>",
"pass": "<pass id>"
});Subtotal: 24.00 CAD
Tax: 0.00 CAD
Total: 24.00 CAD
Amount due: 0.00 CAD
Nothing is owed, so sessions_book_session
can book this outright.{
"checkoutPreview": {
"subtotal": 2400,
"discountCents": 0,
"taxCents": 0,
"giftCardCreditCents": 0,
"total": 2400,
"amountDueCents": 0,
"errors": []
},
"currency": "cad"
}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.