Aviasales Flight Prices

v0.5.3
io.github.stufently/aviasales-mcp Checked 4 days ago Published 1 month ago

Flight price search via Aviasales/Travelpayouts: fares by route, cheapest days, flexible dates.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_flights

Search flight prices between two cities on a date or across a month. Use when the user names both ends of a route and wants fares, a booking link, or only departures inside a time window. For the cheapest day in a month use `get_prices_calendar`; for the days around dates already chosen use `get_flexible_date_prices`; for a budget with no destination use `search_by_price_range`. Both codes must be IATA — call `lookup_cities` first if you only have a city name. For nearby airports use `get_alternative_directions`. A multi-city trip needs one call per leg. Note on passengers: the price data…

ParameterTypeDescription
destination *stringDestination city IATA code (e.g. "IST", "BCN").
origin *stringOrigin city IATA code (e.g. "MOW", "LED").
adultsintegerNumber of adult passengers, 1-9 (default 1).
childrenintegerNumber of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed.
currencyPrice currency code (3 letters, e.g. "rub", "usd"). Defaults to the server's configured currency.
depart_afterKeep only flights departing at or after this local time ("HH:MM", 24-hour). Optional.
depart_beforeKeep only flights departing at or before this local time ("HH:MM", 24-hour). Optional. Combined with depart_after and set earlier than it, the window wraps midnight (e.g. 22:00-06:00).
departure_atDeparture date or month (YYYY-MM-DD or YYYY-MM). Optional; a month searches every day in it.
directbooleanIf True, show only non-stop flights.
infantsintegerNumber of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed.
limitintegerMax number of results (1-100, default 10).
market2-letter market whose price cache to read (e.g. "us", "ru", "th"). The same route in the same currency is priced differently per market, so set this to the traveller's country. Defaults to the server'…
one_waybooleanIf True, search one-way tickets only.
return_atReturn date or month (YYYY-MM-DD or YYYY-MM). Optional.
trip_classstring"economy", "comfort", "business" or "first" (default "economy").

get_prices_calendar

Get grouped calendar prices for a route, one fare per day or per month. Use when the user asks which day or month is cheapest to fly a known route. For fares on one specific date use `search_flights`; for a few days either side of dates already chosen use `get_flexible_date_prices`. Codes are IATA; use `lookup_cities` to resolve a name first. Prices are per adult (cached); passenger parameters are encoded into each booking_link.

ParameterTypeDescription
destination *stringDestination IATA code.
origin *stringOrigin IATA code.
adultsintegerNumber of adult passengers, 1-9 (default 1).
childrenintegerNumber of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed.
currencyPrice currency (3 letters). Defaults to the server's currency.
departure_atDeparture month (YYYY-MM). Optional.
group_bystringGroup results by "departure_at" or "month" (default "departure_at").
infantsintegerNumber of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed.
market2-letter market whose price cache to read (e.g. "us", "ru"). Defaults to the server's configured market.
return_atReturn month (YYYY-MM). Optional.
trip_classstring"economy", "comfort", "business" or "first" (default "economy").

get_flexible_date_prices

Compare prices for the days around a departure and an optional return. Use when the user already has dates and asks whether shifting a day either way would be cheaper. For one exact date use `search_flights`; for the cheapest day across a whole month use `get_prices_calendar`. This covers roughly a week around both the outbound and the return.

ParameterTypeDescription
depart_date *stringIntended departure date (YYYY-MM-DD). Required.
destination *stringDestination IATA code.
origin *stringOrigin IATA code.
adultsintegerNumber of adult passengers, 1-9 (default 1).
childrenintegerNumber of children 2-11 years, 0-8 (default 0).
currencyPrice currency (3 letters). Defaults to the server's currency.
infantsintegerNumber of infants under 2, 0-8 (default 0).
market2-letter market whose price cache to read. Defaults to the server's configured market.
return_dateIntended return date (YYYY-MM-DD). Omit for one-way.
trip_classstring"economy", "comfort", "business" or "first" (default "economy").

get_latest_prices

Get the most recently found flight prices from other travellers' searches. Use when the user wants the latest fares that just appeared, on one route or across the whole cache. For a specific trip on chosen dates use `search_flights` instead. Prices are per adult (cached); passenger parameters are encoded into each booking_link. These rows come from the older v2 shape: they name the selling `agency` rather than an airline, carry no flight number, and their booking_link is reconstructed from the route and dates.

ParameterTypeDescription
adultsintegerNumber of adult passengers, 1-9 (default 1).
childrenintegerNumber of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed.
currencyPrice currency (3 letters). Defaults to the server's currency.
destinationDestination IATA code. Optional.
infantsintegerNumber of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed.
limitintegerMax results (1-100, default 20).
market2-letter market whose price cache to read. Defaults to the server's configured market.
one_waybooleanOne-way tickets only.
originOrigin IATA code. Optional.
trip_classstring"economy", "comfort", "business" or "first" (default "economy").

get_city_directions

List the cheapest destinations reachable from a city, with a fare and dates. Use when the user asks where they can fly from a city, or wants somewhere cheap without naming a destination. For who flies into a city use `get_popular_directions`; to price one chosen route afterwards use `search_flights` or `get_prices_calendar`.

ParameterTypeDescription
origin *stringOrigin city IATA code (e.g. "MOW"). Use `lookup_cities` to resolve a city name first.
currencyPrice currency (3 letters). Defaults to the server's currency.

get_alternative_directions

Get prices for nearby airports and cities around a chosen route. Use when the traveller can fly from or into a different airport and wants those fares. To learn which airports are near a place, use `find_nearest_airports` first; for the named city pair only, use `search_flights`.

ParameterTypeDescription
destination *stringDestination IATA code.
origin *stringOrigin IATA code.
currencyPrice currency (3 letters). Defaults to the server's currency.
departure_atDeparture date (YYYY-MM-DD or YYYY-MM). Optional.
limitintegerMax results (1-20, default 10).
market2-letter market whose price cache to read. Defaults to the server's configured market.
return_atReturn date (YYYY-MM-DD or YYYY-MM). Optional.

search_by_price_range

Find flights whose cached fare falls inside a minimum and maximum price. Use when the user has a budget, including anywhere under a price with no destination named. Leave `destination` unset to let the budget pick the city; prices are per adult in economy. For a named route on a date or a month use `search_flights` or `get_prices_calendar`. There is deliberately no date argument: this endpoint ignores one (verified — passing a December date returns the same July and September fares), and each result carries its own `departure_at`.

ParameterTypeDescription
origin *stringOrigin IATA code.
value_max *integerHighest acceptable price, in `currency`.
value_min *integerLowest acceptable price, in `currency`.
currencyPrice currency (3 letters). Defaults to the server's currency.
destinationDestination IATA code. Optional — omit to search anywhere.
limitintegerMax results (1-100, default 20).
market2-letter market whose price cache to read. Defaults to the server's configured market.

lookup_airlines

Look up airlines by name or IATA code. Use when the user asks which airline a code belongs to, or wants the IATA code for an airline name. For an airport, city, or country code use `lookup_airports`, `lookup_cities`, or `lookup_countries`; for fares use `search_flights`.

ParameterTypeDescription
limitintegerMax results to return (1-500, default 50).
locale2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale.
searchAirline name substring or exact IATA code (e.g. "aeroflot", "SU"). Omit to list airlines from the start of the dataset.

lookup_airports

Look up airports by name, IATA code, or city code. Use when the user names an airport or a code and needs its city, country, or coordinates. For the closest airport to a town that does not share the airport's name, use `find_nearest_airports` instead of this tool. The full dataset is ~10k airports, so always pass `search` — an unfiltered call just returns the first `limit` entries in dataset order. Results are ranked: exact code, then exact city code, then name matches, with airports you cannot actually fly to last.

ParameterTypeDescription
limitintegerMax results to return (1-500, default 50).
locale2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale.
searchAirport name substring, exact IATA code, or city code (e.g. "heathrow", "LHR", "MOW").

lookup_cities

Look up cities by name or IATA code and return the code flight tools expect. Use when the user names a city and a flight search needs its IATA code. For an airport code use `lookup_airports`; for the nearest airport to a place that is not itself a city, use `find_nearest_airports`. Every flight tool takes IATA codes, so this is usually the first call when the user names a place. The full dataset is ~9.6k cities, so always pass `search`. Names are only available in the requested locale: searching "Мюнхен" needs locale="ru".

ParameterTypeDescription
limitintegerMax results to return (1-500, default 50).
locale2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale.
searchCity name substring or exact IATA code (e.g. "bangkok", "BKK").

lookup_countries

Look up countries by name or two-letter country code. Use when the user asks which country a code belongs to, or wants that country's code or currency. For a city or airport code use `lookup_cities` or `lookup_airports`; this tool does not search flight prices.

ParameterTypeDescription
limitintegerMax results to return (1-500, default 50).
locale2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale.
searchCountry name substring or exact code (e.g. "thailand", "TH").

find_nearest_airports

Find the airports closest to a place name or to a latitude and longitude. Use when the user asks which airport to fly into for a town, a resort, or a point on the map. `lookup_airports` only matches a name, and the nearest airport is rarely named after the town, so call this tool for that question. Feed the returned city code, not the airport code, to `search_flights` for fares. Pass either `near` (resolved against the city and airport datasets) or an explicit `latitude`/`longitude` pair.

ParameterTypeDescription
flightable_onlybooleanSkip airports with no scheduled service (default True).
latitudeLatitude in degrees, -90 to 90. Overrides `near`.
limitintegerMax airports to return (1-50, default 5).
locale2-letter locale for names. Defaults to the server's locale.
longitudeLongitude in degrees, -180 to 180. Overrides `near`.
max_distance_kmIgnore airports further away than this. Optional.
nearPlace name or IATA code to search around (e.g. "Pattaya", "UTP").