Skip to main content
Glama

cwsi.net Fare Classes & Mileage Calculators

Royal Air Maroc Safar Flyer Calculator

calculate_royal_air_maroc_miles
Read-onlyIdempotent

Royal Air Maroc Safar Flyer Award Miles, Status Miles and Status Flights for Royal Air Maroc flights. Award Miles = distance x fare family % (fam: Eco Essential 50, Eco Classic 100, Family Classic 100, Eco Flex 150, Biz Classic 150, Biz Flex 200), rounded down per flight; Status Miles are the same. The Silver, Gold and Platinum bonus (50%, 75%, 100%) adds Award Miles only. Royal Air Maroc publishes no minimum for short flights, so none is applied, and no fare-family weighting for Status Flights, so each flight counts as one. Set noearn to Y for an award, Cash and Miles or E-class-without-luggage ticket (earns nothing). Progress toward Silver (20,000 Status Miles or 15 Status Flights), Gold (35,000 or 30) and Platinum (75,000 or 75) in a calendar year; qm and qf are the totals so far. 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
qfNoStatus Flights you have this calendar year (optional). Each flight flown counts as one.
qmNoStatus Miles you have this calendar year (optional). Used only for the progress toward the next Safar Flyer status.
famNoFare family. EE = Eco Essential (Economy, 50%); EC = Eco Classic (Economy, 100%); FC = Family Classic (Economy, 100%); EF = Eco Flex (Economy, 150%); BC = Biz Classic (Business, 150%); BF = Biz Flex (Business, 200%). The fare family on your Royal Air Maroc ticket. Eco Essential earns half the distance; Biz Flex earns double.EC
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
noearnNoIs it an award ticket, a Cash and Miles ticket or an E class booking without luggage?. N = No; Y = Yes (earns nothing). Royal Air Maroc says these earn no Miles. Choose No if you do not know.N
statusNoYour Safar Flyer status. BL = Blue or not yet a member; SI = Silver (+50%); GO = Gold (+75%); PL = Platinum (+100%). The Silver, Gold and Platinum bonus is paid on Award Miles for Royal Air Maroc flights; it does not count toward status.BL
creditToNoCredit the flights to a partner program instead of Royal Air Maroc's own: american = American AAdvantage (creditStatus one of: AAdvantage member, AAdvantage Gold, AAdvantage Platinum, AAdvantage Platinum Pro, AAdvantage Executive Platinum); alaska = Atmos Rewards (creditStatus one of: Atmos Rewards member, Atmos Silver, Atmos Gold, Atmos Platinum, Atmos Titanium); ba-club = British Airways Club (creditStatus one of: Blue, Bronze, 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. Give the booking class letter as creditClass. The flights are segs (their miles), or creditFlights.
creditClassNoThe booking class letter on the ticket, for creditTo (required with creditTo). 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. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare this as a read-only, idempotent, non-destructive calculator. The description goes well beyond that by disclosing the exact earning formula, per-flight rounding, that no minimum applies, that Status Flights are not fare-family weighted, that status bonuses apply only to Award Miles, the noearn exception cases, and that the tool is unofficial and uses cwsi.net and published rules.

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?

The description is front-loaded with purpose and core formula, then flows into rules and parameter guidance. It is dense and long, but the complexity of an 11-parameter airline earning calculator largely justifies the length. A few details repeat the schema's enum descriptions (e.g., fare-family percentages), which slightly reduces efficiency.

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?

An output schema exists, so return values need not be explained, and annotations cover the safety profile. The description supplies the remaining critical context: calculation rules, rounding, status thresholds, noearn exceptions, partner crediting behavior, ordering requirement for segs, and an unofficial-data caveat. An agent has enough to invoke the tool correctly.

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 coverage is 100%, so the baseline is 3. The description adds meaning beyond individual schema fields by explaining the cross-parameter formula (distance × fare family %, rounded per flight), how status bonuses interact with Award Miles only, and that qm and qf are year-to-date totals. Some enum details duplicate the schema, but the computational relationship adds valuable semantics.

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 description states a specific verb (calculates Award Miles, Status Miles and Status Flights) and resource (Royal Air Maroc Safar Flyer) with clear scope (Royal Air Maroc flights). It distinguishes itself from sibling airline calculators by naming the airline and loyalty program, and it explicitly names calculate_flight_distance as a helper.

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?

The description explains when to set noearn to Y, when the status bonus applies, and how to use creditTo for partner programs versus leaving it out for Royal Air Maroc's own program. It does not explicitly name alternative sibling calculators or state 'do not use for other airlines,' but the first sentence and tool name make the intended use 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