search_flights
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. With to=anywhere (or no destination), add earliest/latest and/or min_days/max_days to get first the destinations whose round trip departs and returns inside that window with a trip length in range (one_way=true for one-way departures inside it); each result carries depart_date, return_date and a booking link. Without them, anywhere mode is origin-only inspiration. When fewer than three trips match a dated anywhere search exactly (a small airport), labelled near matches follow the exact ones: the same airport with dates or trip length moved slightly, then nearby airports (the requested dates and length preferred, else the same slight moves). Each result's relaxed list names what it does not match (dates, trip_length, origin; empty = exact), origin and origin_distance_km name the airport it leaves from, and match_note says it in words: tell the traveler. Pass fallback=false for exact matches only. Several departure airports: pass a comma-separated from (up to 4, e.g. from=BOH,LGW or airport:BOH,airport:LGW) to get ONE merged list, cheapest first, each result's origin naming the airport it leaves from and its booking link departing there; the search budget is split across them (multi_origin hint) and near matches are added around the first listed one. Narrow to=anywhere with to_country (ISO codes, e.g. to_country=ES,PT) and/or to_continent (EU, AF, AS, NA, SA, OC, AN; Turkey and Cyprus count as Europe too), or name the places in to (to=BCN,AGP,PMI, up to 8): only destinations inside the filter are priced and returned (destination_filter hint). Named places, and one destination with several origins, return one cheapest trip per origin and place, always dated. 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. A city:/airport: prefix that contradicts its code (city:CDG names an airport, airport:PAR names a city) is likewise searched as the identity the catalog does know, with a selector_corrected entry in metadata.hints naming the requested and used tokens. Dates already in the past get the same treatment: a window that only STARTS in the past is searched from today with a window_clamped entry in metadata.hints, and a window that has already ENDED is not searched at all — the results are empty and a window_in_past entry names a suggested window to ask for instead, so do not retry the same dates. 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. Pass sellers=false when the traveler wants the price picture but is not booking through this answer: it skips the live seller-quote wave, so the ranked calendar fares, booking links and metadata.route_price_check still come back but metadata.seller_enrichment_status is skipped and no seller quote, seller-level baggage fee or direct seller action is resolved. Each result carries local flight times when known (outbound_departure_local, outbound_arrival_local, return_departure_local, return_arrival_local), nights_at_destination (outbound landing date to return departure date) and arrival_home_date; schedule_status says known, partial or unknown — never present an unknown time as known. For a school-holiday style question pass trip_length=nights (min_days/max_days then count nights at the destination) and arrive_by_latest=true (the return lands home by latest); fares without the needed times are left out and counted in the schedule_filter hint. For a family or group, pass adults (1-9), children (ages 2-11) and lap infants (never more than adults); at most 9 seated. Each result's price stays the one-adult price (price_scope=per_adult), the booking link opens prefilled for the whole party, and party_total_estimate gives per-adult price x seated passengers as an ESTIMATE (exact=false; infant, baggage and seller fees excluded) — present it as an estimate, never as the total. Party searches skip the seller-quote wave (party_seller_wave_skipped hint). 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.
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": {
"from": "<from>"
},
"name": "search_flights"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ch | No | Acquisition 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 |
| to | No | Destination 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. A comma-separated list of up to 8 places (`BCN,AGP,PMI`) narrows an anywhere search to exactly those destinations: each is priced directly (no discovery), one cheapest trip per origin and destination, and the answer is always dated (a missing window or trip length gets route search's defaults). The same happens for one destination with several origins in `from`. | |
| from | Yes | Origin 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. Several origins: a comma-separated list of up to 4 (`BOH,LGW`, `airport:BOH,city:LON`) searches them as one request and returns one merged list, cheapest first, each result's `origin` naming the airport it leaves from (the anywhere answer shape, also when `to` names one destination). The request's Travelpayouts budget is split evenly across them, so each checks fewer destinations than a search from it alone; a `multi_origin` entry in `metadata.hints` says how many. A thin merged answer first checks the rest of what each origin checks alone; near matches (see `fallback`) are then added around the first listed origin. | |
| cabin | No | Cabin 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_n | No | Maximum number of results to return, sorted cheapest-first. Specific routes allow up to 50; anywhere mode returns at most 12. | |
| adults | No | Adults (12+) traveling, 1-9, default 1. Prices stay per adult (`results[].price_scope` = `per_adult`): the fare sources quote one adult. A party other than one adult prefills the booking link for the whole party and adds `results[].party_total_estimate` — the per-adult price x seated passengers, labelled as an estimate (`exact: false`), never the seller's total. Seated passengers (adults + children) are at most 9. Applies to specific routes and anywhere mode. | |
| latest | No | Latest 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). A window ending before today is not searched; the response is empty with a `window_in_past` hint. In anywhere mode the return (or one-way departure) must also fall on or before this date. With `arrive_by_latest=true` the last flight must also LAND by it. | |
| verify | No | How 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 |
| infants | No | Lap infants (under 2, on an adult's lap), 0-4, default 0, never more than `adults`. They prefill the booking link but take no seat and are not in `party_total_estimate`; the seller prices infant fees. | |
| one_way | No | If true, search one-way flights; return_date and duration_days will be null. | |
| sellers | No | Whether to run the live seller-quote wave (Google Flights `booking_options`) for this request. Default `true`: unchanged behavior — the bounded frontier resolves seller prices, baggage basis, and the executable booking action. Set `sellers=false` to ask for the ranked fare calendar and the route-level price check ONLY: the response then carries `metadata.seller_enrichment_status="skipped"`, results keep their Travelpayouts-grounded prices and durable booking links, and no seller quote, seller-level baggage fee, or direct seller action is resolved. It exists for callers that want the price picture cheaply and do not intend to book — our own curve-seeding crons use it — because the seller wave is where a search's provider spend actually goes (about seven of its ~eight calls). Non-economy cabins have no calendar source, so `sellers=false` there leaves `metadata.route_price_check` as the only priced evidence and `results` may be empty. | |
| children | No | Children aged 2-11 traveling, 0-8, default 0. Each takes a seat and counts in `party_total_estimate` at the per-adult price (children usually pay the adult fare on low-cost carriers). A party search skips the live seller-quote wave: `metadata.seller_enrichment_status` is `skipped` and a `party_seller_wave_skipped` entry in `metadata.hints` says why. | |
| currency | No | Result currency, 3-letter ISO code UPPERCASE. | USD |
| earliest | No | Earliest 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`. A date already in the past is clamped to today and reported as `window_clamped` in `metadata.hints` — unless `latest` has passed too, in which case the whole window is declined rather than clamped (see `latest`). In anywhere mode it restricts results to trips departing on or after this date; omit it (and `latest`, `min_days`, `max_days`) for origin-only inspiration. | |
| fallback | No | Dated anywhere mode only (`to=anywhere` with `earliest`/`latest` and/or `min_days`/`max_days`). Default `true`: when fewer than 3 trips match the request exactly, labelled near matches follow the exact ones: first from the same origin with dates moved up to 7 days (inside the same calendar months) or trip length changed up to 2 days, then, if still too few, from nearby city markets with an airport within 150 km (straight line; a fare may leave from another airport of that market, and its own distance is shown): a trip there that fits the requested window and trip length is preferred, otherwise its nearest trip within the same relaxed bounds is used. Each result's `relaxed` list says what it does not match (`dates`, `trip_length`, `origin`; empty = exact), `origin` and `origin_distance_km` name the airport it leaves from, and an `anywhere_fallback` entry in `metadata.hints` says what was done. Exact matches come first, cheapest first; then same-airport near matches, closest to the request first (fewest days off), then cheapest; then nearby-airport ones, each airport's own sorted the same way and the airports taking turns, nearest first. Set `fallback=false` to get only exact matches (possibly none). With several origins in `from` the fallback runs once, when the merged exact answer is thin, around the first listed origin; a destination filter applies to its near matches too. Ignored by specific-route searches and the dateless anywhere board. | |
| max_days | No | Maximum round-trip duration in days (return - departure); ignored for one-way. With `trip_length=nights`, the maximum nights at the destination instead. In anywhere mode, setting it restricts results to round trips of at most this length inside the window. | |
| min_days | No | Minimum round-trip duration in days (return - departure); ignored for one-way. With `trip_length=nights`, the minimum nights at the destination instead. In anywhere mode, setting it restricts results to round trips of at least this length inside the window. | |
| to_country | No | Anywhere mode only: return only destinations in these countries, a comma-separated list of up to 10 ISO 3166 two-letter codes (`ES`, `ES,PT`; case-insensitive). The filter is applied to the candidate destinations BEFORE any is priced, so the whole call budget goes to destinations inside it. Works with or without dates, with several origins and with `to_continent` (a destination must match both). A `destination_filter` entry in `metadata.hints` echoes it. Rejected with a specific `to`. | |
| trip_length | No | How `min_days`/`max_days` measure a round trip. `days` (default): days between the outbound and return departure dates, as before. `nights`: nights at the destination, from the local date the outbound LANDS to the local date the return departs — a 7-day trip whose outbound lands after midnight is 6 nights. Needs flight times: a fare whose times are unknown is left out (never counted as matching) and counted in the `schedule_filter` entry of `metadata.hints`; that entry is present whenever this or `arrive_by_latest` is on. The live seller-quote wave is skipped (its quotes have no return times). Ignored for one-way. Specific routes and anywhere mode. | days |
| checked_bags | No | Checked 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. | |
| to_continent | No | Anywhere mode only: return only destinations on these continents: `AF` (Africa), `AN` (Antarctica), `AS` (Asia), `EU` (Europe), `NA` (North America), `OC` (Oceania), `SA` (South America); comma-separated, case-insensitive. Countries spanning Europe and Asia (Turkey, Cyprus, Russia, Georgia, Armenia, Azerbaijan, Kazakhstan) count in both. Applied before pricing, like `to_country`. | |
| max_transfers | No | Maximum number of transfers/layovers per leg. 0 = nonstop only, 1 = up to 1 stop, etc. Omit for no filter. | |
| arrive_by_latest | No | If true, the trip's last flight must LAND on or before `latest` (local date): the return flight home for a round trip, the outbound for one-way. Default false keeps today's rule (`latest` bounds the return departure). Fares whose arrival time is unknown are left out and counted as for `trip_length=nights`. Specific routes and anywhere mode. |