Skip to main content
Glama

search_flights

Search for flights by route and date, compare prices, durations, stops, and airlines. Filter by budget, cabin class, time windows, and more, including one-way, round-trip, and multi-city.

Instructions

Search for flights using Google Flights data via SerpAPI. Returns best_flights and other_flights with full details (price, duration, stops, airline, aircraft, legroom, amenities, carbon emissions) plus price_insights (lowest price, typical range, price history).

Each result includes a booking_token (to get booking links) and for one-way results a departure_token (to get matching return flights for round-trips).

Supports one-way, round-trip, and multi-city. Filters include: nonstop only, max price, cabin class, specific airlines, departure/arrival time windows, layover duration, connecting airport exclusions, and emissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
glNoCountry code for results (e.g. us, gb, fr)
hlNoLanguage code (e.g. en, es, fr)
bagsNoNumber of carry-on bags
typeNo1=Round trip (default), 2=One way, 3=Multi-city
stopsNo0=Any stops, 1=Nonstop only, 2=1 stop or fewer, 3=2 stops or fewer
adultsNoNumber of adults (default 1)
sort_byNo1=Top flights, 2=Price, 3=Departure time, 4=Arrival time, 5=Duration, 6=Emissions
childrenNoNumber of children
currencyNoCurrency code (e.g. USD, GBP, EUR)
emissionsNoSet to 1 to only show low-emission flights
max_priceNoMaximum ticket price
arrival_idYesArrival airport IATA code (e.g. JFK) or Google kgmid. Comma-separate for multiple.
deep_searchNoEnable deeper search matching browser results (slower)
return_dateNoReturn date (YYYY-MM-DD). Required for round-trip.
show_hiddenNoInclude hidden/unlisted flight results
departure_idYesDeparture airport IATA code (e.g. LHR) or Google kgmid (/m/...)
max_durationNoMaximum total flight duration in minutes
return_timesNoReturn flight time range. Same format as outbound_times.
travel_classNo1=Economy, 2=Premium economy, 3=Business, 4=First
exclude_basicNoExclude basic economy fares (US domestic only, requires gl=us and economy class)
exclude_connsNoComma-separated airport codes to exclude as connections
outbound_dateYesOutbound date (YYYY-MM-DD)
infants_on_lapNoInfants on lap
outbound_timesNoDeparture time range as 'min,max' hours (e.g. '6,20') or 'depMin,depMax,arrMin,arrMax'
infants_in_seatNoInfants in seat
multi_city_jsonNoJSON array of legs for multi-city (type=3). Each leg: {"departure_id":"CDG","arrival_id":"LHR","date":"YYYY-MM-DD"}
exclude_airlinesNoComma-separated airline IATA codes to exclude. Cannot combine with include_airlines.
include_airlinesNoComma-separated airline IATA codes to include (e.g. BA,AA). Cannot combine with exclude_airlines.
layover_durationNoLayover duration range in minutes as 'min,max' (e.g. '60,240')
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently describes the return payload (best_flights/other_flights, price_insights), the booking_token for booking links, and the departure_token for one-way results, adding context beyond the schema. It does not mention rate limits, error conditions, or pagination, but for a read-only search tool, the core behavioral traits are well disclosed.

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 organized into three compact paragraphs: purpose and return values, token behavior, and capability summary. It front-loads the core purpose and packs dense information without unnecessary fluff. It is somewhat long but proportional to the tool's complexity, and every sentence contributes meaningful detail.

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?

Given 29 parameters, no output schema, and 12 sibling tools, the description is remarkably complete. It covers the return structure, token handling, supported trip types, and filter options. Missing are explicit caveats like mutual exclusivity (partially in schema), pagination, or route limitations, but these are secondary for initial selection and invocation.

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?

The schema already provides 100% coverage of all 29 parameters with detailed descriptions and enums, so the additional value is inherently limited. The description adds a high-level filter overview ('nonstop only, max price, cabin class, specific airlines, departure/arrival time windows, layover duration, connecting airport exclusions, and emissions'), helping an agent group related parameters, but it does not introduce new semantic details for individual parameters beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Search for flights using Google Flights data via SerpAPI.' It clearly enumerates the return fields (price, duration, stops, etc.) and tokens (booking_token, departure_token), making the tool's function concrete and distinct from generic search tools. However, it does not explicitly contrast with any of the 12 sibling tools, so it stops short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The description implies usage scenarios by stating it 'Supports one-way, round-trip, and multi-city' and listing filters, which tells an agent what configurations are possible. However, it provides no explicit guidance on when to choose this tool over siblings like search_flights_flexible or explore_destinations, nor does it mention any exclusions or limitations.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RuairidhT/flights-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server