Skip to main content
Glama

post_rates_prebook

Create a prebook session to verify hotel rate availability and final pricing before payment, returning a prebookId for completing the booking.

Instructions

Overview

Step 1 of 2 in the booking flow. Create a prebook session to check the availability of a rate and get final pricing before payment. This prebookId needed to complete the booking.

When to Use

  • Before payment - Always call this before completing a booking

  • Rate confirmation - Verify final pricing and availability

  • Session creation - Generate a checkout session for your payment flow

What You Get

  • Prebook ID - Required for the next step (completing the booking)

  • Final pricing - Confirmed rates with all fees and taxes

  • Terms and conditions - Cancellation policies and booking rules

  • Room details - Complete information about the selected rooms

Key Features

  • Live availability check - Verifies the rate is available before you collect payment

  • Payment SDK support - Set usePaymentSdk=true to use client-side payment forms

  • Reusable - PrebookId can be used for multiple bookings if needed

Quick Start

Provide the offerId from your hotel rates search and set usePaymentSdk (true/false). Returns a prebookId to use in the next step.

Next Step: Use the prebookId with /rates/book to complete the booking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addonsNoA list of additional services or extras that can be added to the booking. For example, adding an Uber voucher or an esim card. The final booking amount is the sum of the offer's total price and the cost of any addons. Each addon's price is added individually to reflect all extras in the billed total.
offerIdYesThe unique identifier of the selected offer from the search results.
paymentNoOptional payment configuration when usePaymentSdk is true
timeoutNo
bedTypeIdsNoAn optional array of bed type IDs to specify preferred bed configurations for the rooms being booked. The availability of specific bed types depends on the hotel's inventory.
voucherCodeNoAn optional voucher code to apply discounts to the booking. The vouchers API allows creation of these discounts
usePaymentSdkYesSpecifies whether the fields needed to call the payment processing SDK are returned. Set to true if using the SDK for payment processing.
includeCreditBalanceNoOptional flag to include credit line information in the response. When set to true, credit line details will be returned if the user has a credit line available.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, and destructiveHint=false. The description adds useful behavioral context beyond annotations, including that it creates a reusable prebook session, performs a live availability check, and returns final pricing and terms. It does not cover authentication, rate limits, or session expiration.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with an Overview and uses clear sections, making it scannable. However, it is longer than necessary and repeats key points across When to Use, What You Get, Key Features, and Quick Start.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description appropriately lists what the tool returns: prebookId, final pricing, terms and conditions, and room details. It also covers the workflow position and next step, making it complete enough for an agent to call and use the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 88%, so the schema already documents nearly all parameters. The description adds minor usage context for the required offerId and usePaymentSdk parameters but does not explain the optional parameters (addons, payment, timeout, bedTypeIds, voucherCode, includeCreditBalance) beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: create a prebook session to check rate availability and obtain final pricing. It also distinguishes the tool's role as Step 1 of 2 in the booking flow and names the next sibling endpoint, /rates/book.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use the tool: before payment, for rate confirmation, and for session creation. It also tells the agent to provide the offerId from hotel rates search and to use the resulting prebookId with /rates/book, making the workflow unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools