Search flights
search_flightsFind flights between two cities or airports and pick the dates. Handles vague requests directly — e.g. 'mid-December, 2-3 days, not on a weekend': pass earliest_depart/latest_return, nights_min/nights_max and avoid_weekdays and it returns the cheapest matching date pairs with fares. Also: exact dates, no date (cheapest dates), no destination (cheapest destinations, same filters apply). With dates (exact or a window) it checks live fares on Google Flights; otherwise, and as a fallback, it uses fares Aviasales travellers saw recently, each with the day seen and a link that reopens that fare at today's price.
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": {
"origin": "<origin>"
},
"name": "search_flights"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| month | No | Flexible dates within this month, YYYY-MM (used when depart_date is omitted). | |
| adults | No | ||
| origin | Yes | Departure city or airport (name or IATA code), e.g. 'Madrid' or 'MAD'. | |
| currency | No | 3-letter currency for fares, e.g. EUR, USD. | USD |
| nights_max | No | Longest stay in nights for a flexible trip ('2-3 days' → 3). | |
| nights_min | No | Shortest stay in nights for a flexible trip ('2-3 days' → 2). | |
| depart_date | No | Departure date, YYYY-MM-DD. Omit for flexible dates: returns the cheapest recently seen dates. | |
| destination | No | Arrival city or airport (name or IATA code), e.g. 'Lisbon'. Omit for 'anywhere': returns the cheapest destinations. | |
| return_date | No | Return date, YYYY-MM-DD. Omit for one-way. | |
| latest_return | No | Flexible trip window end, YYYY-MM-DD: be back by this day. | |
| avoid_weekdays | No | Days the trip must not touch, from departure to return day inclusive ('no weekend' → ['sat','sun']). | |
| earliest_depart | No | Flexible trip window start, YYYY-MM-DD ('mid-December' → 2026-12-10). Use with latest_return and/or nights instead of fixed dates: the tool picks the cheapest date pairs itself. |