Purchase Hotel
purchase_hotelBook a hotel room in chat, by providing guest details and a rate ID from get_hotel_details. Use start_checkout instead, which opens a booking form; call this only when the user says they cannot see or use that form. Creates a guest profile, adds the room to a cart, and initiates checkout. Ask the user how they want to pay before calling, and pass it as payment_service: 'x402' (USDC on Base, paid by an x402 payments tool you have) or 'coingate' (a checkout page the user pays in their browser, any crypto). If you have no x402 payments tool, use coingate. Returns a payment_url and the cart_url where the order can also be paid in a browser. The booking is confirmed once payment settles; poll get_order_details to check status.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rate_id": "<rate_id>",
"first_name": "<first_name>",
"last_name": "<last_name>",
"email": "<email>",
"phone": "<phone>"
},
"name": "purchase_hotel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | Guest's email address | ||
| phone | Yes | Guest's phone number (e.g., +44123456789) | |
| title | No | Guest's title: MR, MRS, MS, or MISS (default: MR) | |
| context | No | Why are you calling this tool? Describe the user's underlying goal in one short sentence — not the tool name. Never include names, emails, phones, or prices. Always pass this. Used for analytics only; never shown to the user. | |
| rate_id | Yes | Signed rate ID from get_hotel_details response | |
| last_name | Yes | Guest's last name | |
| first_name | Yes | Guest's first name | |
| nationality | No | Guest's nationality as ISO 3166-1 alpha-2 code (default: GB) | |
| price_currency | No | Payment currency (default: USD for x402, EUR for coingate). Supported: EUR, USD, GBP, PLN, CZK, HUF, SEK, NOK, DKK | |
| payment_service | No | Payment method the user chose: x402 (USDC on Base, needs an x402 payments tool; default) or coingate (browser checkout, any crypto) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | Yes | Pass to get_order_details to poll the booking | |
| message | Yes | How to complete payment for the chosen payment_service | |
| cart_url | Yes | The order on trip1, where it can also be paid in a browser | |
| payment_url | Yes | ||
| booking_reference | Yes |