Skip to main content
Glama

MAQAMI Travel

post_bookings_bookingid_alternative_prebooks

Overview

Hard Amendment — Search for alternative rates at the same hotel and create ready-to-book prebook sessions for a confirmed booking. Used when the guest needs to change their check-in/check-out dates or room occupancy.

When to Use

  • Date changes — Guest needs different check-in or check-out dates

  • Occupancy changes — Guest needs a different number of adults or children

  • Hard amendments — Situations where the booking must be cancelled and re-booked with new parameters

How It Works

  1. The system searches for live availability at the same hotel with the new parameters.

  2. Up to maxPrebooks alternative rates are selected (sorted by price ascending). Defaults to 3 when omitted; capped at 10 (any larger value is silently clamped to 10).

  3. A prebook session is created for each rate.

  4. The caller receives a list of prebookId values ready to be used with POST /rates/rebook.

What You Get

  • Up to maxPrebooks prebook sessions — Each with a prebookId, final pricing, cancellation policies, and room details

  • Price comparison — priceDifferencePercent shows how each alternative compares to the original booking's selling price (negative = cheaper than what the guest paid, positive = more expensive)

  • Policy change flags — cancellationChanged and boardChanged highlight any policy differences

Completing the Amendment

Pass the chosen prebookId and the original bookingId as existingBookingId to POST /rates/rebook. On success, the new booking is created and the original booking is automatically cancelled — no separate cancellation call is needed.

Key Notes

  • The booking must be in CONFIRMED status.

  • If the original booking is non-refundable, only non-refundable alternatives are returned (unless overridden with refundableRatesOnly).

  • Payment type is honoured — only rates that support the original booking's payment type are returned. A pay-at-property booking only sees PROPERTY_PAY alternatives; every other booking (including pay-later, succeeded, credit_line) only sees NUITEE_PAY alternatives. Pay-later eligibility additionally requires a refundable rate, which is enforced automatically when the original booking was refundable.

  • The nationality and currency of the original booking are used for the availability search.

  • If the cancellation of the original booking fails after the new booking is created, the error is logged but the new booking is still returned.

Quick Start

  1. Call this endpoint with the bookingId and new occupancies/dates — get back up to maxPrebooks prebookId values.

  2. Call POST /rates/rebook with the chosen prebookId and existingBookingId — new booking confirmed, original cancelled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
checkinNoThe new check-in date in YYYY-MM-DD format. Must be before `checkout`.
checkoutNoThe new check-out date in YYYY-MM-DD format. Must be after `checkin`.
boardTypeNoFilter results by board/meal-plan type (e.g. `RO` for Room Only, `BB` for Bed & Breakfast). Leave empty to return all board types.
bookingIdYes(Required) The unique identifier of the confirmed booking to amend.
maxPrebooksNoMaximum number of alternative prebook sessions to create. Defaults to 3 when omitted. Values above 10 are silently capped at 10; values ≤ 0 fall back to the default. The response may contain fewer entries when the hotel does not have enough distinct alternative offers.
occupanciesYesThe desired room occupancies for the amended stay. One entry per room.
refundableRatesOnlyNoWhen true, only fully refundable alternative rates are returned. Defaults to false (or true if the original booking was refundable).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Rich beyond the annotations: silent clamping of maxPrebooks to 10, default/≤0 fallback behavior, refundable-only restriction for non-refundable originals, payment-type honoring (PROPERTY_PAY vs NUITEE_PAY), use of original nationality/currency, and explicit partial-failure semantics ('cancellation failure logged but new booking returned'). This is consistent with readOnlyHint=false / destructiveHint=false / idempotentHint=false.

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?

Well front-loaded with Overview then When to Use / How It Works / What You Get / Key Notes. It is on the long side and some content repeats across 'How It Works', 'Completing the Amendment', and 'Quick Start', but every section carries distinct information.

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 'What You Get' section fully describes the return payload (prebookId, final pricing, cancellation policies, room details, priceDifferencePercent, cancellationChanged/boardChanged). Given seven params, a mutation with open-world behavior, and async follow-up steps, the description covers everything needed to call it correctly.

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 the baseline is 3, but the description adds real meaning: maxPrebooks defaults/caps and 'sorted by price ascending', refundableRatesOnly default that depends on the original booking's refundability, and occupancy-driven search. These are behavioral semantics the schema does not convey.

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?

States a specific verb+resource: 'Search for alternative rates at the same hotel and create ready-to-book prebook sessions for a confirmed booking,' and frames it as a 'Hard Amendment' with a one-line scenario (date/occupancy change). This lets an agent distinguish it from soft-amendment and rebook siblings 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 Guidelines4/5

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

The 'When to Use' section gives three concrete triggering conditions (date changes, occupancy changes, hard amendments) and the precondition (booking must be CONFIRMED). It clearly says what follows (POST /rates/rebook), though it never names a sibling like put_bookings_bookingid_amend for the soft-amendment alternative, so routing is implied rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources