get_replacement_traffic
Fetch replacement buses, coaches, or taxis for cancelled Swedish trains, including stops, times, delays, and wheelchair access; filter by station, replaced train number, or departure date.
Instructions
Get replacement traffic (ersättningstrafik) for Swedish trains: the buses, coaches or taxis that run instead of cancelled trains, with the replaced train numbers, vehicle type, status (planned, ordered, confirmed, running, finished, canceled), wheelchair access, toilet, and every stop with stop description (where to board), planned/expected/actual times, delay in minutes and traveller notes. Filter by station (name or signature; the stop there is returned as atStation), by replaced train number, and/or by the replaced train's departure date; otherwise trips from minutesBack before now to hoursAhead after now. Operators report this voluntarily, so not every replacement is listed: use get_train_announcements to see which trains are cancelled and get_train_messages for the disruption behind them. fetchedAt is when this server got the response from Trafikverket; the result does not refresh afterwards, so call the tool again if fetchedAt is old. lastUpdated is when Trafikverket last changed the record: an old value does not necessarily mean stale data, and it does not confirm that the data is still current. Returns an error result (isError: true) if TRAFIKVERKET_API_KEY is missing/invalid or the Trafikverket API is unreachable. Coverage: Sweden only (Trafikverket data).
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": "get_replacement_traffic"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Departure date (YYYY-MM-DD) of the replaced train. When set, the whole day is searched and minutesBack/hoursAhead are ignored | |
| limit | No | Maximum number of trips to return (1-50) | |
| station | No | Only trips stopping at this station: name (e.g. "Lund C", "Malmö") or location signature (e.g. "Lu") | |
| hoursAhead | No | Include trips departing up to this many hours after now (0.5-48, default 12) | |
| minutesBack | No | Include trips still running or departing up to this many minutes before now (0-240, default 30) | |
| trainNumber | No | Only trips replacing this advertised train number, e.g. "1043" |