get_train_announcements
Check live train departures or arrivals at a Swedish station, including platform, delays, cancellations and deviation notes; provide station name or signature and the time window.
Instructions
Get live train departures or arrivals at a Swedish station: train number, operator, product (e.g. "Pendeltåg"), origin/destination, platform (track), advertised vs. estimated/actual time, delay in minutes, cancellation and deviation notes. Accepts a station name (e.g. "Göteborg C", "Stockholm") or a location signature; an ambiguous name returns an error listing the candidates. Covers a window from minutesBack before now to hoursAhead after now. Use get_train_messages for broader disruption notices (track work, faults) instead of per-train data. Times are ISO 8601, delays in minutes (positive = late). delayBasis says what delayMinutes is based on: "actual", "estimated" or "preliminary" (a preliminary estimate); "none" comes with delayMinutes null and means the delay is unknown, not that the train is on time. 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
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": {
"station": "<station>"
},
"name": "get_train_announcements"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of trains to return (1-100) | |
| station | Yes | Station name (e.g. "Göteborg C", "Stockholm") or location signature (e.g. "G", "Cst") | |
| direction | No | "departures" (default) or "arrivals" at the station | departures |
| hoursAhead | No | How many hours ahead of now to include (0.25-12) | |
| minutesBack | No | How many minutes back from now to include, so just-left or delayed trains show up (0-120) |