Skip to main content
Glama

get_train_announcements

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
limitNoMaximum number of trains to return (1-100)
stationYesStation name (e.g. "Göteborg C", "Stockholm") or location signature (e.g. "G", "Cst")
directionNo"departures" (default) or "arrivals" at the stationdepartures
hoursAheadNoHow many hours ahead of now to include (0.25-12)
minutesBackNoHow many minutes back from now to include, so just-left or delayed trains show up (0-120)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, yet the description still adds substantial context: results do not refresh after fetching, lastUpdated does not confirm currency, and the tool returns isError:true when TRAFIKVERKET_API_KEY is missing or the API is unreachable. The delayBasis semantics (including that "none" means unknown rather than on time) are a genuinely useful disclosure beyond annotations.

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 purpose and the sibling alternative, then return-field semantics. It is a dense single block of ~150 words with no wasted clause, but the return-value notes would scan better as a short structured list rather than one long paragraph.

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?

There is no output schema, so the description carries the burden of explaining return values, which it does thoroughly: ISO 8601 times, delay sign convention, delayBasis values, fetchedAt vs. lastUpdated meaning, and error results. An agent has everything needed to call and interpret this tool without guessing.

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 coverage is 100%, so all five parameters, their ranges and the direction enum are already documented in the schema. The description only restates the station name-or-signature form and the minutesBack-to-hoursAhead window, adding the ambiguity-error behavior but no new syntax or format guidance. Baseline 3 applies.

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?

Opens with a specific verb and resource ("Get live train departures or arrivals at a Swedish station") and enumerates the exact fields returned (train number, operator, product, platform, delay, cancellation notes). It is immediately distinguishable from the sibling get_train_messages, which is explicitly named as the broader-notice alternative.

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?

Explicitly routes the agent: "Use get_train_messages for broader disruption notices (track work, faults) instead of per-train data." It also states coverage limits (Sweden only), the ambiguity failure mode (an ambiguous name returns an error listing candidates), and the refresh rule (call again if fetchedAt is old).

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