Skip to main content
Glama

get_train_messages

Read-onlyIdempotent

Retrieve current Swedish railway disruption messages, including track work, faults, affected stations and sections, optionally filtered by county, to answer questions about rail traffic issues.

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. Returns an error result (isError: true) if TRAFIKVERKET_API_KEY is missing/invalid or the Trafikverket API is unreachable. Coverage: Sweden only (Trafikverket data).

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of messages to return (1-100)
countyNoOptional county filter: Swedish county name (e.g. "Skåne", "Västra Götaland") or county code (e.g. 14)
activeOnlyNoOnly include messages that have not ended yet (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover the safe read-only profile, but the description adds valuable behavioral context: the required TRAFIKVERKET_API_KEY error condition and Sweden-only coverage. It does not discuss rate limits or ordering, which keeps it from a 5, but it meaningfully exceeds the structured annotations.

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

Conciseness5/5

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

The description is front-loaded with purpose, then usage guidance, error behavior, and coverage. Every sentence contributes useful information, and the return field list is warranted because no output schema exists.

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 read-only, optional-parameter listing tool with no output schema, the description covers purpose, return contents, alternative tools, auth failure behavior, and geographic coverage. Nothing material is missing for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so all parameters are already documented. The description only mentions the optional county filter, adding little beyond what the schema provides, which makes the baseline 3 appropriate.

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?

The description states a specific verb and resource ('Get current railway traffic messages from Trafikverket') and enumerates the disruption types and returned fields. It explicitly contrasts itself with get_train_announcements, so an agent can distinguish it from a sibling without reading schemas.

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?

It gives an explicit use case ('is there a disruption on the railway') and names the alternative tool for per-train timetable and delay data. The geographic scope and county filter are also clearly stated.

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