Skip to main content
Glama

google_flights

Destructive

当用户需要查询 Google Flights 航班信息、机票价格、往返/单程/多城市航班、舱位、航空公司、经停、行李或排放过滤结果时触发。

Input Schema

NameRequiredDescriptionDefault
glNo定义 Google Flights 搜索要使用的国家/地区。它是一个两位数的国家/地区代码。例如 us 代表美国,uk 代表英国,fr 代表法国。
hlNo定义 Google Flights 搜索要使用的语言。它是一个两位数的语言代码。例如 en 代表英语,es 代表西班牙语,fr 代表法语。
bagsNo定义随身行李数量。默认为 0。此参数不应超过允许携带随身行李的乘客总数(成人、儿童和占座婴儿)。0
jsonNo定义采集结果的输出格式。1 返回 JSON 格式数据,2 返回 JSON+HTML 格式数据,3 返回 HTML 格式数据,4 返回 Light JSON。默认值为 1。1
typeNo定义航班类型。1 为往返(默认),2 为单程,3 为多城市。当此参数设置为 3 时,使用 multi_city_json 设置航班信息。1
stopsNo定义航班经停次数。0 为任何经停次数(默认),1 为仅直飞,2 为 1 次或更少经停,3 为 2 次或更少经停。0
adultsNo定义成人数量。默认为 1。1
sort_byNo定义结果的排序顺序。1 为优选航班(默认),2 为价格,3 为起飞时间,4 为到达时间,5 为飞行时长,6 为排放量。1
childrenNo定义儿童数量。默认为 0。0
currencyNo定义返回价格的货币。默认为 USD。USD
no_cacheNo默认情况下,5 分钟内缓存相同参数的搜索结果。设为 true 可跳过缓存,设为 false(默认)则使用缓存结果。缓存搜索免费,且不计入搜索统计。false
emissionsNo定义航班的排放水平。1 表示仅选择低碳排放航班。
max_priceNo定义最高机票价格。默认为无限制。
arrival_idNo定义到达机场代码或地点 kgmid。例如 /m/0vzm 是德克萨斯州奥斯汀的地点 kgmid。可以通过逗号分隔指定多个到达机场。例如 CDG,ORY,/m/04jpl。
deep_searchNo设置为 true 以启用深度搜索,这可能会产生更好的结果,但响应时间更长。深度搜索结果与浏览器中 Google Flights 页面上找到的结果相同。出于性能考虑,默认情况下此选项设置为 false。false
return_dateNo定义返程日期,格式为 YYYY-MM-DD。例如 2026-03-19。如果 type 参数设置为 1(往返),则此参数为必填。
show_hiddenNo设置为 true 以包含隐藏的航班结果。默认为 false。false
departure_idNo定义出发机场代码或地点 kgmid。可以通过逗号分隔指定多个出发机场。例如 CDG,ORY,/m/04jpl。
max_durationNo定义最长飞行时长(以分钟为单位)。例如 1500 表示 25 小时。
return_timesNo定义返程时间范围。它是一个包含两个(仅起飞)或四个(起飞和到达)逗号分隔数字的字符串。每个数字代表一个小时的开始。
travel_classNo定义旅行舱位。1 为经济舱(默认),2 为高级经济舱,3 为商务舱,4 为头等舱。1
exclude_basicNo设置为 true 以排除基础经济舱结果。得到的票价将包含免费选座和随身行李。默认为 false。目前,此过滤器仅适用于美国国内航班,且只能在 gl 为 us 且 travel_class 为 1 时使用。false
exclude_connsNo定义要排除的中转机场代码。机场 ID 为大写 3 字母代码,可以在 Google Flights 或 IATA 上搜索。
outbound_dateNo定义出发日期,格式为 YYYY-MM-DD。例如 2026-03-13。
infants_on_lapNo定义不占座婴儿数量。默认为 0。0
outbound_timesNo定义出发时间范围。它是一个包含两个(仅起飞)或四个(起飞和到达)逗号分隔数字的字符串。
departure_tokenNo用于选择航班并获取返程航班(对于往返航班)或行程下一段的航班(对于多城市航班)。在出发航班结果中找到此令牌。它不能与 booking_token 一起使用。
infants_in_seatNo定义占座婴儿数量。默认为 0。0
multi_city_jsonNo定义多城市航班的航班信息。它是一个包含多个航班信息对象的 JSON 字符串。
exclude_airlinesNo定义要排除的航空公司代码。多个航空公司用逗号分隔。不能与 include_airlines 一起使用。
include_airlinesNo定义要包含的航空公司代码。多个航空公司用逗号分隔。不能与 exclude_airlines 一起使用。
layover_durationNo定义中转时长(以分钟为单位)。它是一个包含两个逗号分隔数字的字符串。例如 90,330 表示 1 小时 30 分钟到 5 小时 30 分钟。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already declare openWorldHint=true and destructiveHint=true, so the safety profile is partly covered externally. The description itself adds no behavioral context at all — nothing about caching (no_cache), the latency cost of deep_search, token-based multi-step flows, or credit consumption. For a 32-parameter scraper with non-trivial side effects, this is a meaningful gap.

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?

A single, front-loaded sentence with zero filler. It is efficient, though for a 32-parameter tool with a multi-step booking workflow the extreme brevity borders on under-specification rather than optimal conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

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

This is a complex tool — 32 params, no output schema, round-trip/multi-city flows involving departure_token and multi_city_json — yet the description is one trigger clause. It omits the two-step selection workflow and cost/latency trade-offs that an agent needs to call it correctly, so it is not complete for the tool's complexity.

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 every one of the 32 parameters carries its own inline description, so the schema does the heavy lifting. The tool description supplies no additional parameter meaning, which matches the baseline 3 for fully documented schemas.

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 names a specific verb and resource (查询 Google Flights 航班信息/机票价格) and enumerates the concrete query dimensions it supports (round-trip/one-way/multi-city, cabin, airlines, stops, baggage, emissions). It clearly distinguishes this from sibling search tools. However, it is framed as a trigger condition rather than a purpose statement and does not explicitly differentiate itself from e.g. google_hotels or google_search.

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 entire sentence is a when-to-trigger condition, so usage context is implied and reasonably clear. It never states when NOT to use it, nor names an alternative tool, and it omits key prerequisites such as needing a departure_id/outbound_date before it is useful.

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