| name | flights |
| description | Flight search: cheap dates, specific flights, connections, comparing
options. International routes — via Google Flights (CLI `fli`),
Russia/CIS — via Aviasales/Travelpayouts (curl). Both paths need no MCP,
so the skill works in any topic.
Use when (EN): "find flights", "find plane tickets", "how long is the
flight", "cheap tickets", "ticket to", "flight to", "when is it cheaper
to fly", "flights from X to Y", "round trip", "airfare".
Use when (RU): "найди билеты", "найди авиабилеты", "сколько лететь",
"дешёвые билеты", "билет до", "перелёт", "когда дешевле лететь",
"рейсы из X в Y", "туда-обратно".
|
Flight Search
Search flights via Google Flights using the fli CLI (called from Bash —
no MCP needed). The command is already on PATH; if it isn't found, use the
full path ~/.local/bin/fli.
Where to start
You need: airports (or cities → pick IATA codes yourself), date(s), one-way
or round trip. If something is missing — ask one short question, but don't
interrogate: sensible defaults (economy, any connections, nearest weekend)
beat a long questionnaire.
Route — determine the type first
Step 1. Does the route touch Russia/CIS? (either end is a Russian
airport: SVO/DME/VKO Moscow, LED St. Petersburg, OVB Novosibirsk, AER Sochi,
KZN, SVX, KJA, UFA, etc., or both ends inside RU/AM/GE/AZ/KZ/UZ/BY/MD)
- Yes → do NOT use Google Flights/
fli for it (it barely sells RU, returns
price=0/empty — that is not "no flights", don't present it as truth).
Search via Travelpayouts (Aviasales cache) — see the "Russia/CIS
search" section below. If it's a ground leg across RU/Caucasus — suggest
the rzd-trains skill.
- No (EU/UK/US/Asia, Western/Gulf carriers) → continue,
fli works great.
Step 2. Closed sky (RU ↔ EU/UK/US/Cyprus direct)? No direct flights
since February 2022. Don't search for a direct one — build it as two
one-ways through a hub (Istanbul IST, Dubai DXB, Yerevan EVN, Belgrade BEG):
fli for the Western leg + an aviasales link for the RU leg.
How to search (Google Flights via fli)
Flexible dates — find a cheap day first:
fli dates JFK LHR --from 2026-07-01 --to 2026-07-31 --stops NON_STOP --sort
(-R/--round -d <days> for round trip, -c BUSINESS for cabin class)
Specific date — flights, always --format json for parsing:
fli flights JFK LHR 2026-07-15 --sort CHEAPEST --format json
fli flights JFK LHR 2026-07-15 -r 2026-07-22 -s NON_STOP --format json
Useful flags: -t 6-20 (departure window), -a BA KL (airlines),
-c ECONOMY|BUSINESS, -s NON_STOP|1|2, --exclude-basic (no basic
economy), --bags 1.
If the request is broad (many dates/destinations) — wrap heavy calls in an
Agent so large JSON doesn't flood the context; parse with jq.
Russia/CIS search (Travelpayouts / Aviasales cache)
For RU/CIS routes use the Travelpayouts API. The key lives in a separate
file ~/.config/travelpayouts.sh (line export TRAVEL_PAYOUTS_API_KEY=...).
Do NOT use source — in some topics it's blocked by permissions (as is the
Read tool on ~/.config). Pull the token straight into curl via grep
(allowed everywhere) — the substitution below never prints the value to chat:
"token=$(grep -oE '=.*' ~/.config/travelpayouts.sh | grep -oE '[A-Za-z0-9_-]+')"
This is a cache of recent Aviasales searches, not a live GDS: popular
routes (Moscow↔St. Petersburg/Sochi/Yekaterinburg, etc.) are usually there,
rare regional or far-out dates may return 0–3 results. The city code MOW
covers SVO+DME+VKO+ZIA, LED is St. Petersburg; for a specific airport pass
its code (SVO). RU prices — currency=rub, international — eur.
Specific date, one-way (main query):
curl -sG "https://api.travelpayouts.com/aviasales/v3/prices_for_dates" \
--data-urlencode "origin=MOW" --data-urlencode "destination=AER" \
--data-urlencode "departure_at=2026-07-15" --data-urlencode "currency=rub" \
--data-urlencode "sorting=price" --data-urlencode "direct=false" \
--data-urlencode "limit=30" \
--data-urlencode "token=$(grep -oE '=.*' ~/.config/travelpayouts.sh | grep -oE '[A-Za-z0-9_-]+')" \
| jq -r '.data | sort_by(.price)[] | "\(.departure_at[0:16]) \(.origin_airport)→\(.destination_airport) \(.airline)\(.flight_number) \(.price) RUB transfers=\(.transfers)"'
Round trip: add --data-urlencode "return_at=YYYY-MM-DD".
Flexible dates (cheapest day, calendar):
curl -sG "https://api.travelpayouts.com/v1/prices/calendar" \
--data-urlencode "origin=MOW" --data-urlencode "destination=AER" \
--data-urlencode "depart_date=2026-07-15" --data-urlencode "currency=rub" \
--data-urlencode "calendar_type=departure_date" \
--data-urlencode "token=$(grep -oE '=.*' ~/.config/travelpayouts.sh | grep -oE '[A-Za-z0-9_-]+')" \
| jq -r '.data | to_entries | sort_by(.value.price)[] | "\(.key) \(.value.airline)\(.value.flight_number) \(.value.price) RUB transfers=\(.value.number_of_changes)"'
If prices_for_dates returned ≤3 rows on a popular route — try calendar,
then give the user a direct link to a live search (see below).
Aviasales web link (live search, works from RU without VPN):
https://www.aviasales.ru/search/{ORIG}{DDMM}{DEST}{N} — {DDMM} is
day+month zero-padded (15 July → 1507), {N} is passenger count. Example
Moscow→Sochi, 15 July, 1 passenger: https://www.aviasales.ru/search/MOW1507AER1.
For round trip append {DEST}{DDMM_return}{ORIG}. Always attach this link to
your answer on an RU route so the person can verify live prices.
What to show the user
Parse the JSON and give the person 3–5 best options, via
mcp__bot__send_message:
- total price (the whole trip, not per segment), currency;
- carrier(s), number of connections, total travel time, departure/arrival
times;
- booking link, if available.
Lead with the cheapest and the most convenient (often these are different
options — show both). If they asked "when is it cheaper" — run
fli dates
first, name the best days, then offer to finish with fli flights on the
chosen date.
Don't fan requests across sources at random and don't get stuck: one
correctly chosen source per route type. If it's empty — show what you have
and suggest the next step (other dates, the airline's site, aviasales).
Visualization (optional)
Once options are found, for comparison/route you may call the
travel-infographic skill — but only if a picture genuinely adds meaning.
Next — if you hit a wall
If both sources for the route are empty (Google Flights — on international,
Travelpayouts — on RU/CIS), don't invent prices: show what you have, give a
web link to a live search (aviasales.ru for RU, google.com/flights for the
rest) and suggest other dates/nearby airports.