Skip to main content
Glama

cwsi.net Fare Classes & Mileage Calculators

Air China PhoenixMiles Calculator

calculate_air_china_miles
Read-onlyIdempotent

Air China PhoenixMiles mileage (in kilometres) and qualifying segments for Air China flights. Mileage = distance in km (the great-circle miles x 1.609344; Air China uses the IATA distance) x booking-class %, at least 1,000 km in First, 800 in Business and 500 in Premium Economy and Economy; where Air China prints two rates, the first is a flight within Mainland China (both airports CN) and the second an international or regional flight (Hong Kong, Macao and Taiwan count as regional). Classes O, I, X and N earn nothing. The 25/30/50% elite bonus is a note only. Qualifying kilometres for the flight are not calculated (Air China does not say they equal the mileage earned), so the flight is not added to the progress. Cards need Silver 40,000, Gold 80,000 or Platinum 160,000 qualifying km, or 25 / 40 / 90 qualifying segments, in 12 months; qk and qs are the member's own totals so far, used only for the progress. 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. Takes no price. Uses cwsi.net's calculator and the airline's published rules. Unofficial.

Input Schema

NameRequiredDescriptionDefault
qkNoQualifying kilometres you have in the last 12 months (optional). Used only for the progress toward the next card; the flight is not added.
qsNoQualifying segments you have in the last 12 months (optional). Segments can be fractions, for example 1.1 in Y. Used only for the progress toward the next card; the flight is not added.
clsNoBooking class. F = F (First 300%); A = A (First 200% / 250%); J = J (Business 300% / 250%); C = C (Business 200%); D = D (Business 150%); Z = Z (Business 125%); R = R (Business 110% / 125%); G = G (Premium Economy 110%); E = E (Premium Economy 90%); Y = Y (Economy 110%); B = B (Economy 100% / 110%); M = M (Economy 100%); U = U (Economy 100% / 75%); H = H (Economy 75%); Q = Q (Economy 75%); V = V (Economy 75%); W = W (Economy 50%); S = S (Economy 50%); T = T (Economy 50%); L = L (Economy 25%); K = K (Economy 25%); P = P (Economy 25%); O = O (earns nothing); I = I (earns nothing); X = X (earns nothing); N = N (earns nothing). The letter on your Air China ticket. A class with two percentages pays the first on flights within Mainland China and the second on international and regional flights.Y
segsYesThe 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 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).
tripNoTrip. ow = One way; rt = Round trip. Round trip counts the same flights back the other way.ow
statusNoYour PhoenixMiles card. NO = Not an elite member; SI = Silver (+25%); GO = Gold (+30%); PL = Platinum (+50%). Elite members earn extra mileage on Air China group flights. It is shown as a note, not added, because Air China does not say what it is a percentage of.NO
creditToNoCredit the flights to a partner program instead of Air China's own: united = United MileagePlus (creditStatus one of: General member, Premier Silver, Premier Gold, Premier Platinum, Premier 1K); aeroplan = Aeroplan (creditStatus one of: Aeroplan Member, 25K, 35K, 50K, 75K, Super Elite). 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 booking class is cls (or creditClass). The flights are segs (their miles), or creditFlights.
creditClassNoThe booking class letter for creditTo, when it differs from the class question. Ignored without creditTo.
creditStatusNoYour status in the creditTo program, by its name as listed under creditTo. Defaults to the base level. Ignored without creditTo.
creditFlightsNoThe 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

NameRequiredDescriptionDefault
linkYes
notesYes
inputsYes
airlineYes
headlineYes
progressNo
breakdownYes
calculatorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / creditClass
      Added value: +{
      +  "description": "The booking class letter for creditTo, when it differs from the class question. Ignored without creditTo.",
      +  "pattern": "^[A-Za-z]$",
      +  "type": "string"
      +}
    • addedInput schema / properties / creditFlights
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "properties": {
      +      "from": {
      +        "description": "The departure airport's code; labels the breakdown.",
      +        "pattern": "^[A-Za-z0-9]{3,4}$",
      +        "type": "string"
      +      },
      +      "miles": {
      +        "description": "Great-circle distance of this flight in miles.",
      +        "maximum": 12500,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "to": {
      +        "description": "The arrival airport's code; labels the breakdown.",
      +        "pattern": "^[A-Za-z0-9]{3,4}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "miles"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 8,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / creditStatus
      Added value: +{
      +  "description": "Your status in the creditTo program, by its name as listed under creditTo. Defaults to the base level. Ignored without creditTo.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
    • addedInput schema / properties / creditTo
      Added value: +{
      +  "description": "Credit the flights to a partner program instead of Air China's own: united = United MileagePlus (creditStatus one of: General member, Premier Silver, Premier Gold, Premier Platinum, Premier 1K); aeroplan = Aeroplan (creditStatus one of: Aeroplan Member, 25K, 35K, 50K, 75K, Super Elite). 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 booking class is cls (or creditClass). The flights are segs (their miles), or creditFlights.",
      +  "enum": [
      +    "united",
      +    "aeroplan"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare this is a safe, idempotent, non-open-world read. The description goes well beyond that: it discloses the tool is "Unofficial," uses cwsi.net's calculator plus published rules, takes no price, shows the elite bonus as a note only, and does not add the flight to progress. These are substantive behavioral disclosures.

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?

It is front-loaded with purpose and then flows into rules and usage, with each sentence carrying calculation or input meaning. It is dense and a single unstructured block that repeats some schema content (e.g., O/I/X/N earn nothing), which keeps it from a 5.

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

Completeness5/5

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

For a 10-parameter calculator with an output schema and safety annotations, the description supplies the missing methodology, edge cases (zero-earning classes, dual rates), and progress semantics. Nothing an agent needs to invoke it correctly is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; however the description adds computation semantics the schema lacks, such as the mileage formula (km = IATA distance x 1.609344 x class %), minimums per cabin, dual-rate mainland/regional rule, and the dynamic relationship between cls, creditClass, segs and creditFlights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: PhoenixMiles mileage (in km) and qualifying segments for Air China flights. It is unambiguously distinguishable from its many sibling airline calculators by naming the Air China program and noting it is unofficial.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete input guidance ("Give segs: one entry per one-way flight, in order") and points to the sibling calculate_flight_distance for the miles value, which is a genuine routing hint. It lacks explicit when-not-to-use or a direct contrast against the other airline calculators, but context is clear.

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