Search journeys (timetable + fares)
horariosSearch 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
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Destination station: name or CP code | |
| date | No | Travel date YYYY-MM-DD (Europe/Lisbon). Default: today | |
| from | Yes | Origin station: name (fuzzy, accents optional) or CP code like 94-30007 | |
| lang | No | Language for names and messages | PT |
| after | No | Earliest departure HH:MM | |
| before | No | Latest departure HH:MM | |
| services | No | Keep 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. | |
| passengers | No | Number of adults | |
| direct_only | No | Only journeys without transfers | |
| return_date | No | Optional return date YYYY-MM-DD | |
| travel_class | No | 1 = 1st/Conforto, 2 = 2nd/Turística |