book
bookFull Description
Unified tool for booking a trip. Actions are determined by which object you provide.
SCHEMA: { create?: { // Initiate booking trip_id: string, // Required: ID of the trip to book buyer_contact?: { // Optional: buyer contact info email: string, phone?: string } }, status?: { // Check booking status booking_id: string // Required: ID of the booking to check }, idempotency_key?: string // Prevent duplicate processing }
ACTIONS:
1. CREATE BOOKING (create object): Quotes the trip and returns a Stripe Checkout URL for payment authorization. { "create": { "trip_id": "trip_xxx" } }
Returns: { "checkout_session": { "id": "cs_xxx", "url": "https://checkout.stripe.com/...", // Open this URL for payment "expires_at": "2026-01-08T15:30:00Z" }, "pending_booking": { "id": "bkg_xxx", "status": "awaiting_payment", "trip_id": "trip_xxx" } }
2. CHECK STATUS (status object): Retrieves booking status. If payment is authorized but fulfillment hasn't started, automatically triggers fulfillment. { "status": { "booking_id": "bkg_xxx" } }
Returns: Full booking object with status, items, passengers, totals, payment info.
PREREQUISITES: • Trip must have at least one item (use trip tool with add_item) • Trip must have travelers assigned (use trip tool with upsert_travelers) • Trip must pass validation
WORKFLOW (flights): 1. flight_calendar → offer_token 2. flight_search → trip_item_token 3. trip(add_item) → trip created 4. trip(upsert_travelers) → travelers set 5. book(create={trip_id}) → checkout URL
WORKFLOW (hotels): 1. hotel_search → htl_* offer_id 2. trip(add_item, trip_item_token=htl_*) → trip created 3. trip(upsert_travelers) → travelers set 4. book(create={trip_id}) → checkout URL
Flights and hotels can be in the same trip (single checkout). After book(create), poll with book(status={booking_id}) for confirmation.
EXAMPLES:
1. Create booking: { "create": { "trip_id": "trip_xyz789" } }
2. Create booking with buyer contact: { "create": { "trip_id": "trip_xyz789", "buyer_contact": { "email": "john@example.com", "phone": "+1-555-123-4567" } } }
3. Check booking status: { "status": { "booking_id": "bkg_xxx" } }
Cost: 1 credit per call.
Parameters (0 required, 4 optional)
createobjectInitiate booking for a trip. Quotes the trip and returns a Stripe Checkout URL for payment. Mutually exclusive with `status` — provide exactly one action per call.
idempotency_keystringIdempotency key to prevent duplicate processing
statusobjectCheck the status of an existing booking. If payment is authorized, triggers fulfillment automatically. Mutually exclusive with `create` — provide exactly one action per call.
user_intentstringA concise summary of what the user is trying to accomplish, derived from their message or the conversation context that triggered this tool call. This is used to understand the user's intent and context to improve the overall user experience. - For short, self-contained prompts (e.g. "I want new shoes"), copy the user message as-is. - For longer conversations or detailed requests, summarize the core goal and any relevant context in 1-2 sentences. Focus on intent, constraints, and preferences - not the full dialogue. Before sending, strip all personally identifiable information (PII), including but not limited to: - Names (first, last, usernames, handles) - Email addresses - Phone numbers - Physical addresses (street, city, zip/postal code, country when tied to an individual) - Dates of birth or exact ages - Government-issued ID numbers (SSN, passport, driver's license, etc.) - Payment or financial information (card numbers, bank accounts, etc.) - IP addresses or device identifiers - Account credentials (passwords, tokens, API keys) - Health or biometric data - Any other information that could identify a specific individual Replace stripped values with a generic placeholder (e.g. "[name]", "[email]", "[address]"). Examples: User: "I want red running shoes under $100" -> "I want red running shoes under $100" User: "Hi, I'm John Smith, john@example.com, and I'm looking for flights from Paris to Tokyo for 2 adults departing around mid-June, budget around EUR2000 total" -> "Looking for flights from Paris to Tokyo for 2 adults, mid-June, budget ~EUR2000" User: "I need help resetting my password for account ID acct_12345" -> "I need help resetting my password for account ID [account_id]"