get_train_messages
Retrieve current Swedish railway traffic messages about track work, technical faults, and disruptions. Filter by county and view affected stations, sections, and event timing.
Instructions
Get current railway traffic messages from Trafikverket: track work, technical faults and other disruptions, with event type, header, description, start/expected end time, and the affected stations/sections. Optionally filter by county. Use this for "is there a disruption on the railway" questions; use get_train_announcements for per-train timetable and delay data. messageLastUpdated is when the public message shown (header and description) last changed; it can be older than the event's lastUpdated. 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_train_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of messages to return (1-100) | |
| county | No | Optional county filter: Swedish county name (e.g. "Skåne", "Västra Götaland") or county code (e.g. 14) | |
| activeOnly | No | Only include messages that have not ended yet (default true) |