Skip to main content
Glama

Search flights

post_flights_rates
Read-only

Overview

Search for available flights with real-time pricing from multiple providers. The itinerary must be sent as a non-empty legs array. Each leg follows the provider SearchLeg shape: required origin, destination, and date (YYYY-MM-DD); optional direction (OUTBOUND or INBOUND); optional per-leg filters that override global filters for that leg only.

Not supported: top-level origin, destination, departureDate, or returnDate — use legs only.

When to Use

  • Listings — live prices for search results UI

  • One-way, round-trip, or multi-city — one leg per segment, in order

  • Filtering — cabin class, stops, price, refundability, times (globally or per leg)

What You Get

  • Offers from multiple providers

  • Itineraries with segments, layovers, and durations

  • Price breakdown (fares, taxes, fees) and baggage hints

Key Features

  • Multi-provider aggregation in one request

  • Global filters, sort

Quick Start

Required: legs (at least one object with origin, destination, date), adults (≥ 1), currency

Date limit: each leg date must not be more than 11 months from today.

Round-trip: two legs (e.g. outbound then return with direction OUTBOUND / INBOUND). One-way: one leg.

Booking

The response includes searchUrl, the same search on book.maqami.co. Flights are booked and paid only on MAQAMI's website: post_flights_verify re-prices the chosen offer and returns its checkoutUrl.

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": {
      "legs": "<legs>",
      "adults": "<adults>",
      "currency": "<currency>"
    },
    "name": "post_flights_rates"
  }
}

Input Schema

NameRequiredDescriptionDefault
legsYesOrdered itinerary legs (provider SearchLeg). One-way: one entry. Round-trip: outbound then inbound. Multi-city / open-jaw: additional legs in travel order.
sortNoSort options for results
adultsYesNumber of adults (12+)
countryNoOptional ISO 3166-1 alpha-2 country code for point of sale
filtersNoOptional filters to refine search results
infantsNoNumber of infants (<2)
childrenNoNumber of children (2-11)
currencyYesISO 4217 currency code
sessionIdNoOptional journey session id. Send your own to group the calls of one journey: up to 64 visible ASCII characters without spaces (a value outside these limits is ignored, the call still succeeds). When omitted on rates, MAQAMI creates one and returns it. Every offer remembers the session of its search, so verify and prebook continue it when you do not resend it; on book, an omitted value inherits the session of the prebook.
cabinClassNoCabin class (provider SearchFilters codes only). Same enum as filters.cabinClass.
infantAgesNoAge of each infant (under 2, per IATA). Length must equal infants count. Optional — omit if ages are not relevant.
childrenAgesNoAge of each child (2–11 inclusive, per IATA). Length must equal children count. Optional — omit if ages are not relevant.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / sessionId
      Added value: +{
      +  "description": "Optional journey session id. Send your own to group the calls of one journey: up to 64 visible ASCII characters without spaces (a value outside these limits is ignored, the call still succeeds). When omitted on rates, MAQAMI creates one and returns it. Every offer remembers the session of its search, so verify and prebook continue it when you do not resend it; on book, an omitted value inherits the session of the prebook.",
      +  "type": "string"
      +}
  2. Changed8 schema fields changed
    • addedInput schema / properties / filters / properties / cabinClass / description
      Added value: +"Cabin class filter (maps to provider SearchFilters.cabinClass). Overrides top-level cabinClass for this field when both are set."
    • addedInput schema / properties / filters / properties / cabinClassMatch / description
      Added value: +"'exactly' for exact match, 'at_least' for selected cabin or better"
    • addedInput schema / properties / filters / properties / flightNumbersMatch / description
      Added value: +"'any' = at least one match, 'all' = all specified flights"
    • addedInput schema / properties / filters / properties / legDurations / items / properties / direction / description
      Added value: +"Which leg to constrain"
    • addedInput schema / properties / legs / items / properties / direction / description
      Added value: +"Leg direction (optional; defaults to OUTBOUND on the provider)"
    • addedInput schema / properties / legs / items / properties / filters / properties / flightNumbersMatch / description
      Added value: +"'any' = at least one match, 'all' = all specified flights"
    • addedInput schema / properties / sort / properties / sortBy / description
      Added value: +"Sort by price, duration, departure, arrival, or stops. The stops criterion counts connections plus en-route technical stops (segments[].stopCount)."
    • addedInput schema / properties / sort / properties / sortOrder / description
      Added value: +"asc or desc"
  3. Changed1 schema field changed
    • addedInput schema / properties / filters / properties / preBookingSeatsAllowed
      Added value: +{
      +  "description": "When true, only return offers that allow seat selection before booking (pre-book seat assignment)",
      +  "type": "boolean"
      +}
  4. Changed6 schema fields changed
    • addedInput schema / properties / filters / properties / excludeAirlines
      Added value: +{
      +  "description": "Exclude airlines (2-character IATA airline codes, case-insensitive): a journey is removed when any of its flights is marketed or operated by one of them (codeshares included), and an offer is removed when one of them is its validating (ticketing) carrier. A leg's own filters.excludeAirlines replaces this list on that leg. Airlines excluded on your account are always excluded in addition to this list.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / legs / items / properties / date / description
      Previous value: -"Departure date for this leg (YYYY-MM-DD)"New value: +"Departure date for this leg (YYYY-MM-DD). Must not be more than 11 months from today."
    • addedInput schema / properties / legs / items / properties / filters / properties / excludeAirlines
      Added value: +{
      +  "description": "Exclude airlines on this leg only (2-character IATA airline codes, case-insensitive): a journey is removed when a flight on this leg is marketed or operated by one of them. Replaces the top-level filters.excludeAirlines on this leg; airlines excluded on your account are always excluded.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / legs / items / properties / filters / properties / excludeConnectionAirports / description
      Added value: +"Exclude layovers at these airports (e.g. IST, DOH)"
    • addedInput schema / properties / legs / items / properties / filters / properties / excludeOvernight / description
      Added value: +"Exclude red-eye flights and overnight layovers"
    • addedInput schema / properties / legs / items / properties / filters / properties / flightNumbers / description
      Added value: +"Filter by flight numbers (e.g. SK500, AF123)"
  5. Changed1 schema field changed
    • removedInput schema / properties / margin
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "Optional per-request markup overrides. Each property is a percentage that replaces your account-level flight markup for that category on this search only; categories you omit keep their configured markup. Set at least one property. Only honoured when flight margin editing is enabled for your account; ignored otherwise. `rateSearch` is applied to the fare prices returned by this search; `seats`, `bags` and `penalties` are attached to the returned offerIds and applied when the offer is verified, prebooked and booked.",
      -  "properties": {
      -    "bags": {
      -      "description": "Markup percentage for baggage ancillaries and journey baggage prices.",
      -      "type": "number"
      -    },
      -    "penalties": {
      -      "description": "Markup percentage applied to the displayed airline change / refund fees (`terms.changeFee`, `terms.refundFee`).",
      -      "type": "number"
      -    },
      -    "rateSearch": {
      -      "description": "Fare markup percentage (journey total and per-passenger prices). Takes precedence over any airline/route overrides configured for your account.",
      -      "type": "number"
      -    },
      -    "seats": {
      -      "description": "Markup percentage for seat ancillaries.",
      -      "type": "number"
      -    }
      -  },
      -  "type": "object"
      -}
  6. Changed3 schema fields changed
    • changedInput schema / properties / filters / properties / maxStops / description
      Previous value: -"Maximum number of stops: -1 or omit = any, 0 = nonstop, 1 = 1 or fewer, 2 = 2 or fewer"New value: +"Maximum number of stops: -1 or omit = any, 0 = genuinely non-stop, 1 = 1 or fewer, 2 = 2 or fewer. Stops include both connections between segments and en-route technical stops inside a segment (segments[].stopCount), so a single flight number with a technical landing is excluded by maxStops: 0."
    • addedInput schema / properties / legs / items / properties / filters / properties / maxStops / description
      Added value: +"Max stops for this leg. Counts connections between segments and en-route technical stops inside a segment (segments[].stopCount); 0 = genuinely non-stop."
    • addedInput schema / properties / margin
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional per-request markup overrides. Each property is a percentage that replaces your account-level flight markup for that category on this search only; categories you omit keep their configured markup. Set at least one property. Only honoured when flight margin editing is enabled for your account; ignored otherwise. `rateSearch` is applied to the fare prices returned by this search; `seats`, `bags` and `penalties` are attached to the returned offerIds and applied when the offer is verified, prebooked and booked.",
      +  "properties": {
      +    "bags": {
      +      "description": "Markup percentage for baggage ancillaries and journey baggage prices.",
      +      "type": "number"
      +    },
      +    "penalties": {
      +      "description": "Markup percentage applied to the displayed airline change / refund fees (`terms.changeFee`, `terms.refundFee`).",
      +      "type": "number"
      +    },
      +    "rateSearch": {
      +      "description": "Fare markup percentage (journey total and per-passenger prices). Takes precedence over any airline/route overrides configured for your account.",
      +      "type": "number"
      +    },
      +    "seats": {
      +      "description": "Markup percentage for seat ancillaries.",
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  7. First observed

TDQS

A4.3/5.0
Behavior4/5

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

The annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered. The description adds real behavioral context beyond that: multi-provider aggregation, the 11-month date horizon, the rule that flights are booked and paid only on MAQAMI's website, and the fact that verify continues the search session. It stops short of disclosing result caps, pagination, or provider-timeout behavior, which keeps it from a 5.

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?

Markdown headings make it skimmable and the critical constraint (non-empty `legs`) is front-loaded in the Overview. However, 'What You Get' and 'Key Features' partially duplicate one another, and the Quick Start repeats the legs/date requirements a third time, so it 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.

Completeness4/5

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

For a 12-parameter tool with nested objects and no output schema, the description covers required inputs, the date horizon, itinerary ordering, and a prose summary of the return payload (offers, segments, layovers, price breakdown, baggage hints). It does not cover search timeout/empty-result behavior or any result-size limits, which is the main remaining gap.

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 100% and the schema itself already documents leg shape, per-leg filter overrides, session semantics, and filter precedence in more detail than the description. The description's added value is mostly emphasis — restating that `legs` must be non-empty with origin/destination/date, and explicitly forbidding top-level origin/destination fields — rather than new semantics, so the baseline 3 holds.

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 Overview opens with a specific verb and resource: 'Search for available flights with real-time pricing from multiple providers.' It goes on to distinguish this search step from the booking step by naming `post_flights_verify` as the tool that re-prices a chosen offer, so the agent can tell this apart from its sibling without opening a 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 enumerates concrete scenarios (listings UI, one-way/round-trip/multi-city, filtering), and 'Quick Start' spells out the one-leg vs two-leg patterns. The Booking section explicitly routes post-search work to `post_flights_verify`, and the 'Not supported' note rules out the wrong input shape (top-level origin/destination/departureDate/returnDate).

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