book_appointment
ChatGPTBook one of the free times find_availability returned, by its slot_token — the time, the provider and the services are those of that slot, nothing else is needed. The booking is made for the user's linked Torly account, with the name and contact phone from their Torly profile, and the business is notified. Confirm the exact date, time, service and provider with the user before calling. Requires the linked account with booking permission. A slot_token is valid for 15 minutes: on TOKEN_EXPIRED or OFFER_CHANGED call find_availability again and offer fresh times. SLOT_TAKEN means the time went to somebody else — offer the alternatives returned. ALREADY_BOOKED means this appointment already exists: tell the user, do not book again. Only when can_book is true on the business. The answer carries business_reminder (minutes_before, or null when the business sends none): tell the user when the business will remind them, then ask how long before the appointment they would like a reminder from you and set it with your own reminder feature when you have one — Torly stores no reminder preference.
cancel_booking
ChatGPTCancel one of the user's appointments by its booking_id from list_my_bookings. Confirm with the user which appointment (date, time, business) before calling. The business is notified. Refused when the appointment is too close (WINDOW_CLOSED: the business's cancellation window), has a payment attached (PAYMENT_LOCKED), or cannot be changed (NOT_CHANGEABLE) — then the user contacts the business or uses booking_page. An appointment already cancelled answers ALREADY_CANCELLED. A booking_id that is not the user's answers NOT_FOUND. Requires the linked account with booking permission.
find_availability
ChatGPTFind free appointment times at a business for one or more of its services (service_id values from get_business), with one provider (staff_id) or with 'any' once the user said they have no preference, from a date (YYYY-MM-DD, local to the business; default today) for up to 14 days, optionally only between earliest_time and latest_time (HH:MM). When several providers offer the services and staff_id is omitted, the answer is STAFF_CHOICE_REQUIRED with the providers (and your_last_booking for a linked user): ask the user which provider — or whether anyone is fine — and call again. Returns up to max_slots free times in the business's timezone, each with a slot_token that a later booking needs — offer them as they are and keep the slot_token of the one the user picks; next_available names the first free time after the range when nothing is free. To MOVE an appointment (a booking_id from list_my_bookings), pass for_booking_id instead of business and service_ids: the search keeps its services and duration, treats its own time as free, and returns slot_tokens for reschedule_booking (default: the same provider).
get_business
ChatGPTLook up a business on Torly by its booking page address (torly.cc/<slug>) or slug. Returns the business card: its services (with service_id, duration and price), its team (staff_id), opening hours per weekday, timezone with the current local date and time, booking policies, and booking_mode — 'instant' (this assistant can find times and, when booking is enabled, book), 'on_site_only' (the business takes payment up front: send the user to booking_page) or 'unavailable'. Call this first, then use the returned service_id / staff_id values in find_availability. Show names exactly as returned; never translate or invent services, staff or times. All dates and times are local to the business. For a user whose Torly account is linked, your_last_booking (when present) says when they last booked here, which services and with which provider — offer the same provider first before searching.
get_my_profile
ChatGPTThe user's Torly profile, once their Torly account is linked: the display name and masked contact details Torly holds for bookings made through this assistant, and my_businesses — the businesses the user booked at through their Torly account (booking page address, name, how many bookings, the last booking with its provider), latest first. Use it when the user names a business without a torly.cc address ('my barber', a name): match against my_businesses, confirm, then use that entry's business address; when several could match, ask; when none does, ask for the address. Requires the linked account; if it is not linked yet, the user is asked to connect. No arguments.
list_my_bookings
ChatGPTThe appointments of the user's linked Torly account: those they booked through this assistant or on a Torly booking page while signed in, and those a business made for them on the customer card their own booking created — across all businesses, or one business. Each carries booking_id, the business, the services, the provider, the local date and time, status, and can_cancel / can_reschedule (the business's customer rules). Default: upcoming appointments; when = past or all for others. Appointments made under a phone number or a name without the account are not listed. Requires the linked account.
reschedule_booking
ChatGPTMove one of the user's appointments to a new time: booking_id from list_my_bookings, and the slot_token of a time returned by find_availability called WITH for_booking_id set to that booking_id (a slot_token from an ordinary search is refused). The services and duration stay as they are; the provider is the slot's. Moving changes an existing appointment: the previous time is released at once and may be taken by someone else, so it may not be available again. Confirm the exact new date, time and provider with the user before calling. Refusals: WINDOW_CLOSED, PAYMENT_LOCKED, NOT_CHANGEABLE, ALREADY_CANCELLED; on SLOT_TAKEN offer the alternatives returned; on TOKEN_EXPIRED or OFFER_CHANGED call find_availability with for_booking_id again. Requires the linked account with booking permission.