Skip to main content
Glama

Fares by class

precos
Read-onlyIdempotent

Retrieve fares in EUR per passenger for Portuguese train journey options, covering first and second class, and optionally filter results by train number or travel class.

Instructions

Fares only (EUR per passenger) for each journey option, for 1st and 2nd class. Optionally restrict to one train number or one class.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "precos"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesDestination station: name or CP code
dateNoTravel date YYYY-MM-DD (Europe/Lisbon). Default: today
fromYesOrigin station: name (fuzzy, accents optional) or CP code like 94-30007
langNoLanguage for names and messagesPT
afterNoEarliest departure HH:MM
beforeNoLatest departure HH:MM
servicesNoKeep only journeys whose every leg uses one of these service codes. Valid codes could not be loaded at startup; they are checked against CP at call time.
passengersNoNumber of adults
direct_onlyNoOnly journeys without transfers
return_dateNoOptional return date YYYY-MM-DD
train_numberNoOnly options that include this train
travel_classNoOnly this class (default: both)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world). The description adds useful context about what is returned: fares only, in EUR per passenger, per journey option, for both classes by default. It does not mention error behavior, rate limits, or authentication needs, but the annotation baseline lowers the burden.

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?

Two sentences, front-loaded with the core purpose, and no wasted wording. The optional restriction note is compact and useful.

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?

For a 12-parameter tool with full schema coverage and annotations, the description is complete enough: it explains the return content and the key optional restriction. It does not cover all filters, but the schema carries those details well.

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%, so the schema already documents all parameters thoroughly. The description only restates that train_number and travel_class can optionally restrict results, adding no syntax or meaning beyond 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 clearly states a specific resource (fares in EUR per passenger) and scope (each journey option, 1st and 2nd class). The word 'only' helps distinguish it from schedule-oriented siblings, though no sibling is named explicitly.

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

Usage Guidelines2/5

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

It gives no explicit guidance on when to use this tool versus alternatives such as horarios or link_compra. The only usage information is an optional filtering note about train_number and travel_class, which is parameter guidance rather than tool-selection guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.