Skip to main content
Glama

calculate_flight_earnings

Read-only

Estimate the ELITE-QUALIFYING points a flight earns toward status — British Airways Tier Points, Air France/KLM Flying Blue XP, or American AAdvantage Loyalty Points — plus the great-circle distance. Answers 'how many tier points is LHR–JFK in business?' and 'how many BA tier points for a £600 fare?'. Tier Points and Loyalty Points are revenue-based (pass fare_price); Flying Blue XP is fixed per segment by distance + cabin. Use program slugs: 'british-airways-executive-club', 'air-france-klm-flying-blue', 'american-aadvantage'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cabinNoCabin: economy, premium, business, or first.economy
originYesOrigin airport IATA code, e.g. 'LHR'.
programYesQualifying program slug: 'british-airways-executive-club', 'air-france-klm-flying-blue', or 'american-aadvantage'.
segmentsNoNumber of flight segments/legs (multiplies Flying Blue XP). Default 1.
fare_priceNoFare price for revenue-based programs (BA Tier Points, AA Loyalty Points). Base fare + carrier surcharges, excluding taxes.
destinationYesDestination airport IATA code, e.g. 'JFK'.
fare_currencyNoISO currency of fare_price (e.g. GBP, USD, EUR). Defaults to the program's home currency.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds behavioral distinctions between revenue-based and distance-based earning and commits to returning great-circle distance. It doesn't describe output shape, rounding, or exactness, but for a non-mutating estimator with read-only annotation, that is a minor gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences; the core purpose and supported programs are front-loaded, followed by usage examples and provider slug guidance. No filler or restatement of schema details.

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

Completeness4/5

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

Given 7 parameters, 3 program-specific calculation rules, and no output schema, the description is nearly sufficient: it covers the inputs that matter, the program slugs, and the main output (points + distance). It could add a note that returned values are estimates and maybe rounding, but those are not required for an agent to call it 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 description doesn't need to repeat definitions. It adds meaning by tying fare_price and segments to specific programs ('revenue-based (pass fare_price)' and 'Flying Blue XP is fixed per segment'), and gives program slugs and currency examples. This is a meaningful increment over the schema.

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

Purpose4/5

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

The description opens with a specific verb ('Estimate'), a precise resource (elite-qualifying points a flight earns toward status), and the return of great-circle distance. It gives concrete example questions and names the exact programs, so an agent can identify what it computes. However, it never names a sibling such as get_earning_rates or get_program_rates, so differentiation from those is implicit rather than explicit.

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 clear conditional usage: pass fare_price for revenue-based BA/AA programs, while Flying Blue XP is fixed per segment by distance and cabin. The example questions ('LHR–JFK in business?', '£600 fare?') establish realistic invocation contexts. It stops short of saying 'use X instead when...' or listing exclusions, so it provides clear context without explicit alternatives.

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.