Skip to main content
Glama

cwsi.net Fare Classes & Mileage Calculators

TAP Air Portugal Miles&Go Calculator

calculate_tap_air_portugal_miles
Read-onlyIdempotent

TAP Air Portugal Miles&Go Bonus Miles for TAP flights. Bonus Miles = distance x fare % by zone, rounded down per flight, no minimum: Europe and North Africa (both airports in Europe, including Madeira, the Azores, the Canary Islands, Turkiye and Cyprus, or Morocco, Algeria, Tunisia, Libya and Egypt) Discount 20, Classic 70, Plus 100, Executive 175, Top Executive 200; Intercontinental Discount 20, Basic 50, Classic 100, Plus and Prime 150, Top Prime and Executive 175, Top Executive 200; a codeshare flown by TAP (CS) 40 or 50. The Silver and Gold status bonus is shown as a note, not added. Progress toward Silver, Gold and Navigator by TAP flights (25 / 50 / 70); fl and sm are the flights and Status Miles 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 (they pick the zone). Takes no price. Uses cwsi.net's calculator and the airline's published rules. 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_tap_air_portugal_miles"
  }
}

Input Schema

NameRequiredDescriptionDefault
flNoTAP flights you have flown in your annual period (optional). Silver, Gold and Navigator can be reached with 25, 50 or 70 TAP flights.
smNoStatus Miles you have in your annual period (optional). Shown beside the Status Mile thresholds; this flight's Status Miles are not added.
fareNoFare. DI = Discount (Economy, Europe 20%, intercontinental 20%); BA = Basic (Economy, intercontinental only 50%); CL = Classic (Economy, Europe 70%, intercontinental 100%); PL = Plus (Economy, Europe 100%, intercontinental 150%); PR = Prime (Economy Prime, intercontinental only 150%); TP = Top Prime (Economy Prime, intercontinental only 175%); EX = Executive (Business, Europe 175%, intercontinental 175%); TE = Top Executive (Business, Europe 200%, intercontinental 200%); CS = Codeshare flown by TAP (sold by a partner, flown by TAP: 40% in Europe, 50% intercontinental). The fare name on your booking. TAP earns by fare name, not booking class letter. Basic, Prime and Top Prime are sold only on intercontinental flights.CL
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 TAP Miles&Go status. BS = TAP Miles&Go; SI = Silver; GO = Gold; NA = Navigator. Silver earns 25% and Gold and Navigator 50% extra miles on TAP flights. That bonus is shown as a note, not added to the total.BS
creditToNoCredit the flights to a partner program instead of TAP Air Portugal'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. 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. Changed4 schema fields changed
    • addedInput schema / properties / creditClass
      Added value: +{
      +  "description": "The booking class letter on the ticket, for creditTo (required with creditTo). 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 TAP Air Portugal'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. Give the booking class letter as creditClass. The flights are segs (their miles), or creditFlights.",
      +  "enum": [
      +    "united",
      +    "aeroplan"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld=false, so the bar is lower, yet the description adds real behavior: rounding is down per flight with no minimum, the status bonus is shown as a note and not added, and it discloses sourcing (cwsi.net, published rules, unofficial).

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

Conciseness3/5

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

It is front-loaded correctly (what it computes first, usage second), but it is a very dense, semicolon-heavy wall of text that duplicates the fare-percentage and zone tables already present in the schema, diluting the unique content.

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 the description covers the complex fare/zone/status rules, the segs input shape, the no-price constraint, and the partner-program path. Complete enough for a 10-parameter tool.

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

Parameters3/5

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

Schema description coverage is 100% and every parameter (fare, status, creditTo, segs, etc.) already carries a detailed schema description, so the baseline is 3. The description restates the same zone/fare percentages and status-note rule rather than adding syntax or format meaning the schema lacks.

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 opening sentence names a specific verb/resource pair (TAP Air Portugal Miles&Go Bonus Miles for TAP flights) and immediately specifies the computation rule (distance x fare % by zone, rounded down per flight). Against ~50 sibling airline calculators, the airline-specific scope makes it unambiguous which one to pick.

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 tells the agent how to assemble input (one seg per one-way flight, in order, with great-circle miles) and routes to the sibling tool calculate_flight_distance for those miles, plus notes it takes no price. No explicit when-not guidance, but the usage 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