Skip to main content
Glama

post_flights_bookings_bookingid_cancellations

Cancel a flight booking by ID and get the cancellation outcome, including fees, refund amount, currency, and any vouchers.

Instructions

Overview

Cancels a flight booking. Submits cancellation for an existing booking and returns the cancellation outcome. Call GET /flights/bookings/{bookingId}/cancellations first to preview the financial impact without committing.

If cancellation is accepted but not yet confirmed, this endpoint returns HTTP 202 with status: CONFIRMED (the booking is unchanged until the airline finalizes). Retries while cancellation is still pending are idempotent. While cancellation is awaiting confirmation, a subsequent GET /flights/bookings/{bookingId} includes cancelIntentAt (timestamp of the cancel request). When cancellation completes, the response is HTTP 200 with a final status of CANCELLED or CANCELLED_WITH_CHARGES. All asynchronous cancellation updates are delivered as webhook events — subscribe to flight booking webhooks to receive final confirmation and status changes.

When to Use

  • Confirmed cancellation — Cancel the booking with the airline after the cancel quote has been reviewed and agreed

What You Get

  • bookingId — The LiteAPI booking identifier

  • status — Current booking status: CONFIRMED while cancellation is awaiting airline confirmation (HTTP 202), or final CANCELLED / CANCELLED_WITH_CHARGES (HTTP 200)

  • cancellation_fee — Total cancellation penalty; often 0 on idempotent pending retries

  • refund_amount — Amount to be returned (if any)

  • currency — Currency of the fee and refund amounts

  • destination — Where refunded money goes (original_payment, agency_deposit, voucher, etc.)

  • vouchers[] — Airline travel vouchers when issued in lieu of cash; omitted when absent

Key Features

  • Hotel-parity response — Flat data object with bookingId, status, cancellation_fee, refund_amount, currency, plus optional destination / vouchers

  • Pending cancel intent — HTTP 202 when the airline accepts the cancel but has not confirmed it yet; booking stays CONFIRMED until cancellation is finalized, and GET /flights/bookings/{bookingId} returns cancelIntentAt

  • Fee-based final status — When cancellation completes (HTTP 200), the final status depends on cancellation_fee: if the fee is 0, the booking is fully cancelled (CANCELLED); if the fee is greater than 0, the booking is cancelled with charges retained (CANCELLED_WITH_CHARGES)

Quick Start

Provide the bookingId from POST /flights/bookings in the URL path. No request body is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookingIdYesThe unique booking identifier

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior2/5

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

The description discloses a lot beyond the annotations: HTTP 202 vs 200 semantics, cancelIntentAt on the follow-up GET, webhook delivery, and final status derivation from cancellation_fee. However, it states 'Retries while cancellation is still pending are idempotent', which conflicts with the annotation idempotentHint=false, so an agent could wrongly assume retry safety. That direct conflict with structured metadata is what caps this dimension.

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

Conciseness3/5

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

It is front-loaded with an Overview that leads with the action, which is good, but it is heavily padded with markdown headers and repeated content — the status semantics and pending-cancel behavior are explained in both 'What You Get' and 'Key Features'. For a single-parameter tool this is longer than it needs to be.

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, and the description compensates fully by enumerating the response fields (bookingId, status, cancellation_fee, refund_amount, currency, destination, vouchers[]) and explaining the asynchronous confirmation flow. Nothing an agent needs to invoke or interpret this endpoint is missing.

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% and there is only one parameter, so the schema already carries the baseline. The description still adds value by stating the parameter is a URL path segment taken from POST /flights/bookings and that no request body is required, which the schema does not express.

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 opening line states a specific verb and resource ('Cancels a flight booking') and immediately distinguishes the action from the read-only preview sibling by telling the agent to call GET /flights/bookings/{bookingId}/cancellations first. An agent can tell exactly what this does without opening 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 gives the explicit precondition for calling ('after the cancel quote has been reviewed and agreed') and routes the agent to the preview endpoint (get_flights_bookings_bookingid_cancellations) for the non-committing case. When-to-use, when-not-to-use, and the alternative are all present.

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