Skip to main content
Glama

post_flights_prebooks

Start a flight booking by reserving the selected offer, creating a Stripe payment intent, and retrieving add-ons like seats and baggage in one request.

Instructions

Overview

Initiate a flight booking session by reserving the offer with the provider, creating a payment intent when you use the Stripe SDK, and discovering available ancillary services — all in a single request.

When to Use

  • Start the booking flow once a user has confirmed their flight selection

  • Collect passenger details and initiate payment processing

  • Discover add-ons like seat selection and extra baggage before final confirmation

What You Get

  • Prebook ID required to complete the booking at /flights/bookings

  • Payment intent (transactionId, secretKey) when usePaymentSdk is true — for Stripe SDK integration

  • Credit line snapshot (creditLine in the response) when you set includeCreditBalance: true and your account has an enabled credit line with payment bypass

  • Available services (servicesAttachable) including seats and baggage options

  • Booking confirmation from the provider with reservation details

Key Features

  • End-to-end prebook flow: Verifies offer → payment setup (Stripe payment intent or credit line) → books with provider → fetches services

  • Payment options: usePaymentSdk: true uses the Stripe SDK. usePaymentSdk: false is allowed when your user has payment bypass (sandbox or whitelabel) and either an enabled credit line or a whitelabel/CMI checkout (no Stripe intent; complete payment via WL and call /flights/bookings with payment.method: THIRD_PARTY and payment.token)

  • Ancillary services: Returns attachable services (seats, baggage) that can be added before final booking

  • Same shape as /book: Uses offerId instead of prebookId

Quick Start

Required fields: offerId (from search/verify), contact (name, email, phone), passengers (with birthday, document, and name details).

Payment: Send usePaymentSdk: true for Stripe (typical). Send usePaymentSdk: false when paying on credit line or via whitelabel/CMI (requires payment bypass); otherwise you receive a validation error.

Tip: Use the servicesAttachable in the response to offer seat selection or extra baggage before calling /flights/bookings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactYesPrimary contact person for the booking (receives confirmation emails)
offerIdYesThe offerId from the search results (msgpack-encoded; unpacks to provider offerId)
paymentNoPayment configuration options
passengersYesList of passengers travelling. Length must match the adults+children+infants counts from the search.
voucherCodeNoAn optional voucher code to apply discounts to the booking. The vouchers API allows creation of these discounts
travelPurposeNoOptional purpose of the trip.
usePaymentSdkNoIf true, a Stripe payment intent is created (`transactionId`, `secretKey`). If false, payment bypass must apply and the account must use credit line or whitelabel/CMI checkout (no Stripe intent); otherwise the request is rejected.
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.8/5.0
Behavior5/5

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

Although annotations already declare readOnly=false and openWorld=true, the description adds behaviour those hints cannot: the call actually books with the provider, creates a Stripe payment intent, requires entitlement (payment bypass / enabled credit line) or it 'receives a validation error', and returns a prebook ID plus payment secret. Concurrency is the only gap (non-idempotent retry semantics are not spelled out).

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?

Headers, bullets and a front-loaded Overview make it skimmable, and the Quick Start puts required fields and payment mode in one place. It is verbose for the job, though, with genuine duplication between 'Key Features' and 'Quick Start' (the usePaymentSdk true/false explanation appears three times).

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?

With no output schema, the description carries the return burden and does so: prebook ID, `transactionId`/`secretKey`, `creditLine`, `servicesAttachable`, and provider confirmation. Combined with the workflow position and payment prerequisites, an agent has everything needed to call it correctly in sequence.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: `offerId` must come 'from search/verify', `passengers` length must match search counts is schema-side, and the description explains the conditional semantics of `usePaymentSdk` and what `includeCreditBalance` returns (`creditLine` snapshot). It largely restates required-field lists the schema already carries.

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 opens with a precise verb+resource statement: 'Initiate a flight booking session by reserving the offer with the provider...' and enumerates the three concrete actions (reserve, create payment intent, discover ancillaries). It explicitly distinguishes itself from the sibling endpoints it hands off to (`/flights/bookings`, search/verify), so an agent can place it in the booking flow without reading the schema.

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?

The 'When to Use' section states the triggering condition ('once a user has confirmed their flight selection') and the follow-on step, and the payment section gives explicit when-this/when-that rules for `usePaymentSdk: true` vs `false` (payment bypass + credit line or whitelabel/CMI, else validation error). Alternatives and their preconditions are named rather than implied.

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