Link to buy on cp.pt
link_compraGenerates a cp.pt purchase link for a selected train journey, letting users complete ticket selection, passenger details, and payment on cp.pt without reserving seats or handling payment data.
Instructions
Returns a cp.pt link that opens the search results for a journey, so the user can pick the train, enter passenger details and pay on cp.pt. Pass option_id from horarios to also say which train to select, or from/to/date. This does not reserve seats, create a sale or take any personal or payment data; the user completes the purchase on cp.pt.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "link_compra"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Destination station name or code (when no option_id) | |
| date | No | Travel date YYYY-MM-DD, default today | |
| from | No | Origin station name or code (when no option_id) | |
| lang | No | cp.pt page language | pt |
| option_id | No | Option id from horarios, copied exactly, e.g. '2026-11-30_94-30007_94-2006_c2_p1_out521' | |
| passengers | No | Adults, default 1 | |
| return_date | No | ||
| travel_class | No | Default 2 |