Skip to main content
Glama

Search journeys (timetable + fares)

horarios
Read-only

Search CP train journeys between two stations for a chosen date, with departure times, transfers, legs, and EUR fares per passenger.

Instructions

Search CP train journeys between two stations on a date, with times, transfers, legs and fares (EUR per passenger). Times are HH:MM local; arrives_next_day marks journeys that cross midnight; duration comes from CP. cp_url opens the same search on cp.pt. Each option has an id to pass to link_compra; copy it exactly.

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": "horarios"
  }
}

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
travel_classNo1 = 1st/Conforto, 2 = 2nd/Turística

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, open-world), so the bar is lower, and the description adds real context: results reflect live CP data, times are HH:MM local, arrives_next_day flags cross-midnight journeys, fares are EUR per passenger, and cp_url mirrors the same search on cp.pt. The id handoff instruction to link_compra is genuinely useful cross-tool behavior. It stops short of error modes, empty-result behavior, or rate limiting, so not a 5.

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?

Four tight sentences, front-loaded with what the tool returns, then output-format conventions, then the id handoff. Nothing repeats the name or schema, and each sentence carries information an agent would otherwise have to guess.

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 an 11-parameter, no-output-schema, read-only search tool, the description covers the important return shape: per-option times, legs, transfers, duration, fares, cross-midnight flag, cp_url, and id. Pagination or result-size limits and behavior on no matching journeys are unstated, which keeps it from a 5.

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 11 parameters, including the fuzzy station-name/CP-code duality and the service-code caveat. The description adds only the meaning of fares as EUR per passenger and that times are local HH:MM, which is marginal beyond structured data. Baseline 3 applies.

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 leads with a specific verb and resource: search CP train journeys between two stations on a date, and enumerates what comes back (times, transfers, legs, fares). An agent can tell this is the itinerary search tool. It does not, however, contrast itself with plausible siblings such as mostrar_horarios or partidas_chegadas, so the 5 criterion of sibling differentiation is not met.

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

Usage Guidelines3/5

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

Usage context is implied by 'between two stations on a date' plus the required from/to pair. The only explicit routing is downstream: pass each option's id to link_compra. There is no statement of when to prefer this over mostrar_horarios, procurar_estacao for resolving station names, or precos for pricing.

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