Skip to main content
Glama

get_railway_events

Read-onlyIdempotent

Retrieve Trafikverket railway events for faults, failures and disruptions, including those not made public, and filter by station, status or operative event ID.

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. 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.6/5.0
Behavior4/5

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

Annotations already cover safety (readOnly/idempotent/non-destructive) and open-world access, but the description adds genuinely new behavior: an isError result when TRAFIKVERKET_API_KEY is missing/invalid or the API is unreachable, and the fact that records include non-public, cause-coded events. It stops short of describing result ordering or pagination, so not a 5.

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?

Front-loaded with the core definition and the sibling hand-off, and the dense enumeration of return fields earns its place because there is no output schema. It is a single long block rather than segmented, and the status enum is expanded in both description and schema, a mild redundancy.

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, no-output-schema read tool it covers what an agent needs: what is returned (id, status, reason code, times, sections, related operative event), the auth failure mode, and the geographic limit. No output schema is needed because return values are spelled out in prose.

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?

With 100% schema coverage the baseline is 3, and the description still adds value by glossing the Swedish status semantics and by tying operativeEventId back to the eventId returned by get_train_messages, which the schema does not say. It does not elaborate on limit or activeOnly, leaving those to the schema.

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") plus scope (faults, failures, disruptions in Basun, including events that never became a public traffic message). It explicitly differentiates from the closest sibling: "Use get_train_messages for the public disruption text instead."

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 tool and the condition that selects it (public disruption text → get_train_messages), and states the available narrowing axes (station, status, operative event id). The coverage constraint (Sweden only) further bounds when this tool applies.

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