Air France-KLM Flying Blue Miles and XP Calculator
calculate_flying_blue_milesEstimate the Flying Blue Miles and XP an Air France or KLM ticket earns (set airline to KL for KLM). Miles = fare in EUR (base fare plus carrier surcharge, no taxes) x rate by level (Explorer 4, Silver 6, Gold 7, Platinum 8, Ultimate 9). XP per flight by cabin and distance band (Domestic = both airports in one country; Medium under 2,000 miles; Long 1 to 3,500; Long 2 to 5,000; Long 3 above). Give segs: one entry per one-way flight, in order, with its great-circle miles (calculate_flight_distance gives them) and the ISO country codes of its two airports. Uses cwsi.net's calculator and the airline's published rules. Give the price in EUR, not US dollars. Unofficial.
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": {
"segs": "<segs>"
},
"name": "calculate_flying_blue_miles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xp | No | XP you have so far (optional). Used only for the progress toward the next level. | |
| segs | Yes | The flights, one way and in order, one entry per flight (1 to 8): fromCountry and toCountry, the ISO 3166 two-letter country codes of its two airports; miles, its great-circle distance in miles (1 to 12,500); optional cabin (E, P, B, F) for a flight in another cabin than the ticket's; optional from and to, the IATA codes of its two airports, which label the breakdown; some airlines also use them (Vladivostok, VVO, on JAL and ANA; the Madrid-Barcelona Air Shuttle, MAD-BCN, on Iberia; the long-haul tables named by city on SAS). | |
| trip | No | Trip. ow = One way; rt = Round trip. Round trip counts the same flights back the other way for XP. The fare above is for the whole ticket either way. | ow |
| cabin | No | Cabin. E = Economy; P = Premium; B = Business; F = La Première (Air France). XP depend on the cabin and the distance band, not the booking class. La Première is Air France only. | E |
| level | No | Your Flying Blue level. EX = Explorer (4 per euro); SV = Silver (6 per euro); GD = Gold (7 per euro); PL = Platinum (8 per euro); UL = Ultimate (9 per euro). | EX |
| price | No | Ticket fare in euros (whole trip) in EUR. The base fare plus the carrier-imposed surcharge, without government taxes and airport charges, for the whole ticket. Enter it in euros; Flying Blue converts other currencies itself. Required unless creditTo is given. | |
| airline | No | Airline. AF = Air France; KL = KLM. | AF |
| creditTo | No | Credit the flights to a partner program instead of Air France's own: delta = Delta SkyMiles (creditStatus one of: SkyMiles Member, Silver Medallion, Gold Medallion, Platinum Medallion, Diamond Medallion); flying-club = Flying Club (creditStatus one of: Red, Silver, Gold). Earns by each flight's distance and the booking class at the program's published partner rates; leave creditTo out for the airline's own program. The programs follow the airline in airline (AF: delta, flying-club; KL: delta, flying-club). Give the booking class letter as creditClass. The flights are segs (their miles), or creditFlights. No price is needed with creditTo. | |
| creditClass | No | The booking class letter on the ticket, for creditTo (required with creditTo). Ignored without creditTo. | |
| creditStatus | No | Your status in the creditTo program, by its name as listed under creditTo. Defaults to the base level. Ignored without creditTo. | |
| creditFlights | No | The flights for creditTo: one entry per one-way flight, in order, with its great-circle miles (calculate_flight_distance gives them) and optionally from/to airport codes. Defaults to segs when they carry miles. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| link | Yes | ||
| notes | Yes | ||
| inputs | Yes | ||
| airline | Yes | ||
| headline | Yes | ||
| progress | No | ||
| breakdown | Yes | ||
| calculator | Yes |