Skip to main content
Glama

get_railway_events

Read-onlyIdempotent

Retrieve railway events from Trafikverket—including faults, failures, and disruptions—and filter by station, status, or operative event ID to inspect affected sections and event timing.

Instructions

Get railway events from Trafikverket: faults, failures and disruptions in the railway as registered in Trafikverket's event system (Basun), including ones that never became a public traffic message. Each event has an id, status (Swedish: "Ingen" = only cause-coded, "MöjligOperativHändelse", "BedömdEjOperativHändelse", "OperativHändelse"), reason code, start/end time, the affected sections (from/via/to and intermediate stations) and, when it has one, the id of the related operative event (the eventId returned by get_train_messages). Filter by station (name or signature), status or operative event id. Use get_train_messages for the public disruption text instead. 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_railway_events"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of events to return (1-100)
statusNoOptional event status filter: "Ingen" (only cause-coded), "MöjligOperativHändelse" (possible operative event), "BedömdEjOperativHändelse" (assessed as not operative) or "OperativHändelse" (operative event)
stationNoOptional station name (e.g. "Hässleholm C") or location signature (e.g. "Hm"); only events whose sections start, end, pass via or include this location are returned
activeOnlyNoOnly include events that have not ended yet (no end time, or an end time in the future; default true)
operativeEventIdNoOptional id of an operative event (the eventId from get_train_messages) to list its railway events

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, open-world, non-destructive behavior, and the description still adds substantial context beyond them: results are a snapshot that does not refresh, fetchedAt vs lastUpdated have distinct meanings, errors surface as isError:true when the API key is missing or the API is unreachable, and coverage is Sweden only. These are exactly the operational caveats an agent needs before trusting the data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and sibling differentiation are front-loaded, followed by return-shape and freshness caveats in a logical order. There is some duplication — the Swedish status enum values are restated nearly verbatim from the schema — which costs a little density but does not obscure the message.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter read tool with no output schema, the description enumerates the returned fields (id, status, reason code, times, affected sections, related operative event id), the error mode, and the geographic coverage. An agent has enough to decide, call, and interpret the result without further guessing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the parameter meanings are already documented, and the description largely mirrors them (status values, station name-or-signature). It does add value by linking operativeEventId back to the eventId returned by get_train_messages, making the cross-tool join explicit rather than leaving it to be inferred.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get railway events from Trafikverket: faults, failures and disruptions') and pins down the scope precisely: Basun-registered events, including ones that never became a public traffic message. It explicitly distinguishes itself from the sibling get_train_messages, which carries the public disruption text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names the alternative and the condition that selects it ('Use get_train_messages for the public disruption text instead'), and explains the three filter axes available. It also tells the agent when to re-invoke the tool (stale fetchedAt), which is a usage rule rather than a behavior trait.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.