Search flights
search_flightsFull Description
Search for flights between two airports. Use this when the user wants to find flights, airfare, or air travel options. Returns available flight itineraries with prices, schedules, and airline information.
CRITICAL
- PROMPT FIELD:
- Copy the user's EXACT message into "prompt" - character-for-character, no changes.
- If user wrote "أبحث عن رحلة إلى دبي", pass that EXACT Arabic text.
- NEVER translate the prompt field.
IMPORTANT
- ENGLISH ONLY: All OTHER input argument string values MUST be in English.
If the user writes in Arabic, translate the intent to English before calling this tool. Do NOT include Arabic script in any argument values except "prompt".
IMPORTANT
- AIRPORT CODES: Always use 3-letter IATA airport codes:
- Riyadh: RUH
- Jeddah: JED
- Dubai: DXB
- Abu Dhabi: AUH
- Doha: DOH
- Kuwait: KWI
- Bahrain: BAH
- Muscat: MCT
- Cairo: CAI
- London Heathrow: LHR
DATE PRE-VALIDATION (HARD — DO NOT CALL THE TOOL IF ANY OF THESE FAIL): Before calling search_flights, validate the dates against today. If any check fails, do NOT call the tool. Reply directly to the user, explain which date is invalid, and ask them to provide corrected dates.
- departureDate must be today or later. If departureDate is in the past, do NOT call.
- If returnDate is provided, it must be strictly after departureDate. If returnDate is
the same day or earlier than departureDate, do NOT call the tool. Calling the tool with invalid dates and letting the schema reject is NOT acceptable — catch it before the call.
ROUND-TRIP DURATION LIMIT (HARD): Round-trip searches are capped at 110 days (returnDate - departureDate ≤ 110). If the user asks for a longer trip (e.g. "6 months", "leave in May, return in October"), DO NOT call the tool — tell them the 110-day limit and ask them to shorten the trip or split into separate one-way searches.
FILTER RULES — READ CAREFULLY: The "filters" object must be OMITTED entirely unless the user's words explicitly name a specific filter concept. Common mistakes to AVOID:
- "cheap" / "affordable" / "budget" → use sortBy: "cheapest". Do NOT add any filter.
- "plan a trip" / "organize travel" / "I want to go to X" → general intent. Do NOT add
directOnly, departureTime, or any filter. Leave filters empty.
- "business trip" → does NOT mean cabin: "Business". Only set cabin when user explicitly
says "business class" or "first class".
- "comfortable" / "good" / "nice" → vibes, NOT filters. Leave filters empty.
If in doubt, OMIT the filter. More results is always better than silently excluding flights the user would have wanted.
Parameters (4 required, 5 optional)
departureDatestringDeparture date in YYYY-MM-DD format. Must be today or later — if the user gives a past date, do NOT call this tool, ask for a corrected date instead.
destinationstringDestination airport IATA code (3 letters, e.g., "RUH", "DXB", "JED")
originstringOrigin airport IATA code (3 letters, e.g., "RUH", "DXB", "JED")
promptstringREQUIRED. Copy the user's EXACT original text, character-for-character. If Arabic, pass Arabic. NEVER translate. Used for locale detection and must be present on every tool call.
cabinstringONLY set when user explicitly asks for business or first class. Default is Economy. Do NOT infer from context like "business trip".
EconomyBusinessFirstEconomyfiltersobjectOMIT entirely unless the user explicitly names a filter. "cheap"/"affordable" → use sortBy cheapest, NOT a filter. "plan a trip"/"organize travel" → no filter. "morning flight" → set departureTime. "direct" → set directOnly. When in doubt, OMIT.
passengersobjectPassenger configuration. Default: 1 adult.
{'adults': 1, 'children': 0, 'infants': 0}returnDatestringReturn date in YYYY-MM-DD format (optional for one-way trips). Must be strictly after departureDate — if the user gives a returnDate on or before departureDate, do NOT call this tool, ask for a corrected date instead. Round-trip duration (departureDate → returnDate) must not exceed 110 days.
sortBystringSort order. Set to "cheapest" when the user explicitly mentions price preference (trigger words: "cheapest", "cheap", "cheaper", "budget", "lowest price", "affordable", "most affordable"). Set to "shortest" when they mention time preference ("fastest", "shortest", "quickest"). If no explicit sort preference, leave unset — server default is cheapest. Do NOT infer from soft words like "good", "nice", "best", "any".
cheapestshortestcheapest