Skip to main content
Glama

search_flights

Read-onlyIdempotent

Find the cheapest round-trip across a FLEXIBLE multi-month date window with a min/max trip length — e.g. "10–15 days, anytime Sep–Nov". Search a broad date window rather than requiring the traveler to choose exact dates first. First call the search_locations MCP tool for city or airport names, then pass each returned airport:AAA or city:AAA value unchanged as origin/destination (explicit legacy IATA codes remain supported). Dates are OPTIONAL: add an earliest/latest window when the traveler has one, or omit them (or give just one side) and a sensible default window is searched — metadata.window_defaulted says so and query echoes the window used, so a dateless call always returns flights instead of an error. Add min/max trip duration; get back a ranked list of the cheapest fares (with booking links) plus a price verdict — an honest read of whether the cheapest fare is low, typical, or high versus the route's usual price, or unknown when we lack a usable typical-price band (a price-level read, not a buy-now-or-wait timing prediction). Non-economy requests may return action-bound Google Flights seller quotes or separate route-price evidence in metadata.route_price_check. For a specific route, set checked_bags=1 when the traveler needs one checked bag, then inspect each result's price_basis; anywhere discovery does not support baggage pricing. Checked-bag searches still run seller enrichment but set the fare-only verdict and metadata.route_price_check to null; verify=full does not override that boundary. Use it for any flight question where the dates are flexible, unknown, or the user wants the cheapest time to fly. If a window comes back thin or cannot fit the return, the search widens it one step itself and reports that in metadata.hints — no second call needed. If metadata.refresh_hint is present, this response shipped without something a repeat call can add: issue the same call again immediately (do not sleep or poll) and read refresh_hint.action for what will be included. If you can wait longer for that best-effort cross-check, set verify=full. It uses a longer ~35s budget, but never treats a different airline, itinerary, gate, or booking URL as verification of the displayed offer. Provider failure, unavailability, or a spend cap can still return only cached indicators; always inspect metadata.seller_enrichment_status (applied means complete date-pair coverage put Serp-derived seller data in results; complete means the selected plan and action resolution completed without such data entering results; partial means date-pair or direct-action coverage has gaps though valid seller data may still rank; skipped is reserved for response surfaces where enrichment does not apply) and metadata.seller_enrichment_coverage. That object reports the theoretical query-valid date pairs and how many were targeted/searched; it is not exhaustive provider inventory. Default requests target at most three pairs, while explicit verify=full targets at most seven with bounded longer budgets. Inspect metadata.freshness, and metadata.route_price_check.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chNoAcquisition channel tag (e.g. web, mcp, a campaign name) for first-party analytics. Durable booking links retain the validated Travelpayouts marker for commission but do not trust opaque shortlinks solely to carry provider-dashboard sub_id attribution. Defaults to 'direct'; reduced to a bounded registered channel.direct
toNoDestination location: a legacy code, airport:AAA, or city:AAA. Pass `anywhere` (or omit) to get the cheapest destinations from the origin instead of a specific route.
fromYesOrigin location. Use a legacy 3-letter code (SHA), an exact airport (airport:SHA), or an all-airports city (city:SHA). Required for every search, including to=anywhere.
cabinNoCabin class: economy (default), premium_economy, business, or first. The Travelpayouts calendar covers economy; Google Flights may additionally return action-bound seller quotes for the requested cabin. Actionless evidence remains in metadata.route_price_check.economy
top_nNoMaximum number of results to return, sorted cheapest-first. Specific routes allow up to 50; anywhere mode returns at most 12.
latestNoLatest acceptable return date for round-trip, or latest acceptable departure for one-way (ISO YYYY-MM-DD). Window from earliest must be ≤365 days. Optional: omit it and it is derived from `earliest` (or from the default window when both are omitted). Ignored in anywhere mode.
verifyNoHow hard to cross-check the top result's route, dates, and cabin against Google Flights (SerpApi). `false` (default): the check still runs automatically on a fresh search when the top isn't already a live price, within a client-aware time budget. `true`: force the check even on a cache hit. `full`: THOROUGH mode — force the same best-effort check with a longer ~35s budget and widen the request-local seller/date sample from at most three pairs to at most seven (set it when you can wait, e.g. an autonomous agent). The six-hour base and its cache key do not change. This does not verify the displayed airline, itinerary, gate, or booking URL; inspect `metadata.route_price_check` separately. Checked-bag searches keep this fare-only route check and verdict null even when verify=true or verify=full; seller-level baggage enrichment still runs. Displayed Travelpayouts fares remain explicitly labeled cached indicators. No-op unless a SerpApi key is configured.false
one_wayNoIf true, search one-way flights; return_date and duration_days will be null.
currencyNoResult currency, 3-letter ISO code UPPERCASE.USD
earliestNoEarliest acceptable departure date (ISO YYYY-MM-DD). Optional: omit it and a default window is searched, with the applied window echoed in `query` and flagged by `metadata.window_defaulted`. Ignored in anywhere mode.
max_daysNoMaximum round-trip duration in days (return - departure); ignored for one-way and anywhere mode.
min_daysNoMinimum round-trip duration in days (return - departure); ignored for one-way and anywhere mode.
checked_bagsNoChecked bags requested for the current one-adult, specific-route search contract. Anywhere discovery rejects checked_bags=1. Set to 1 to add a seller's unambiguous first-checked-bag fee to the ranked customer price. Unknown fees remain labeled in results[].price_basis instead of being guessed. Seller enrichment still runs, but the fare-only verdict and route-price check remain null, including when verify=true or verify=full.
max_transfersNoMaximum number of transfers/layovers per leg. 0 = nonstop only, 1 = up to 1 stop, etc. Omit for no filter.

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark it read-only/idempotent/non-destructive, and the description goes well beyond them: it discloses default window behavior, automatic window widening via metadata.hints, refresh_hint semantics, seller_enrichment_status values, verify limitations (does not verify airline/gate/URL), and checked-bag fare-only boundaries. This is rich behavioral context that materially changes how the agent should interpret results.

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 long and dense, but the core purpose and usage guidance are front-loaded, and later sentences cover genuinely needed exceptions and metadata contracts. It could be tightened by pruning some schema-redundant caveats, but it earns most of its length given the tool's complexity.

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 compensates by explaining return content (ranked fares, booking links, price verdict, price_basis, metadata fields) and edge behaviors (thin windows, cached indicators, provider failure, seller enrichment coverage, refresh). For a search tool with 14 parameters and heavy metadata, the behavioral surface is covered thoroughly.

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

Parameters5/5

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

Although the schema already documents 100% of parameters, the description adds crucial semantics: earliest/latest can be omitted and a default window is searched (metadata.window_defaulted), min/max_days frame the round-trip duration, checked_bags disables fare-only verdicts and route-price checks, and verify=full widens the sampled pairs from three to seven. These are operational meanings an agent needs beyond field names and types.

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 sentence states a specific verb ('Find') and resource (cheapest round-trip across a flexible multi-month window with min/max trip length), which clearly differentiates it from an exact-date flight search. It also tells the agent what problem it solves before parameters or metadata are introduced.

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 gives an explicit workflow: call search_locations first, pass the returned airport:/city: values unchanged, and says to use this tool for any flight question where dates are flexible, unknown, or the user wants the cheapest time to fly. It also covers when to set checked_bags, verify=full, and how to handle refresh_hint, leaving no ambiguity about invocation conditions.

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.

TDQS

A4.7/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one resolves location names to typed values, the other searches flights using those values. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tool names follow the same verb_noun pattern: search_flights and search_locations. The naming is predictable and consistent.

Tool Count3/5

Two tools is on the thin side for a flight-search server, but each tool serves a necessary and non-trivial function. The scope is narrow enough that the count is defensible, though a richer surface might include route-specific or date-specific search variants.

Completeness4/5

The tool set covers the core workflow: resolve locations, then search flexible-date flights with pricing context and booking links. Minor gaps exist, such as no explicit tool for comparing specific routes side-by-side or managing search preferences, but the core purpose is well served.