Skip to main content
Glama

Get STPT arrivals

get_arrivals
Read-onlyIdempotent

Retrieve upcoming arrivals at an STPT stop using verified live data or a GTFS timetable fallback, with provenance and live flags to show data freshness.

Instructions

Get upcoming arrivals at an STPT stop. Live data is used only when its freshness is verified; otherwise departures come from the bundled GTFS timetable. Check provenance.freshness, provenance.fallback_reason, and each arrival's live flag.

Input Schema

NameRequiredDescriptionDefault
lineNoOptional line filter such as '2', 'E3', or 'M32'.
limitNoMaximum number of arrivals to return.
stop_idYesNumeric STPT stop ID.

Output Schema

NameRequiredDescriptionDefault
countYes
errorNoStructured failure, if any.
statusYesOverall result status.
stop_idYes
arrivalsNo
stop_nameYes
provenanceNoSource and freshness metadata.
line_filterNo
lookahead_minutesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.3.7
    • addedOutput schema / $defs / Freshness
      Added value: +{
      +  "enum": [
      +    "fresh",
      +    "stale",
      +    "unverified"
      +  ],
      +  "title": "Freshness",
      +  "type": "string"
      +}
    • changedOutput schema / $defs / Provenance / properties / data_age_seconds / description
      Previous value: -"Age of the source/cache entry when returned."New value: +"Age of the upstream observation when returned, in seconds. Null when the age cannot be measured."
    • addedOutput schema / $defs / Provenance / properties / freshness
      Added value: +{
      +  "$ref": "#/$defs/Freshness",
      +  "default": "unverified",
      +  "description": "fresh: an upstream observation time was checked against this server's clock and is within tolerance. stale: the check failed (old, clock-skewed, or frozen data) or a cache entry past its TTL is served. unverified: the data carries no upstream clock reference (schedules, the network snapshot, alerts), so it cannot be confirmed as current."
      +}
    • changedOutput schema / $defs / Provenance / properties / is_stale / description
      Previous value: -"True when the stale cache policy supplied the data."New value: +"True when stale data is being returned, whether from cache or upstream."
    • changedOutput schema / $defs / Provenance / properties / observed_at / description
      Previous value: -"Upstream observation timestamp. Live arrivals expose no timestamp, so this is the fetch time; schedules describe future service and leave it null; vehicles use their upstream timestamp."New value: +"Upstream observation timestamp in UTC. Live arrivals derive it from the feed's own display times and remaining minutes; it is null when the feed carries no clock reference or is rejected as stale. Schedules describe future service and leave it null; vehicles use their upstream timestamp."
  2. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent safety, and the description adds genuinely new behavior: live data only when freshness is verified, GTFS fallback otherwise, and which fields reveal provenance. That is meaningful context beyond the structured hints, though it doesn't mention rate limits or ordering guarantees.

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?

Three tight sentences, front-loaded with the purpose, then the data-source caveat, then the fields to check. No sentence is redundant.

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?

An output schema exists so return values need not be explained, yet the description helpfully points at the exact provenance fields an agent should inspect. Nothing necessary for correct invocation is missing.

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 stop_id, line, and limit are fully documented in the schema. The description adds no syntax, format, or defaulting detail beyond that, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource ('Get upcoming arrivals at an STPT stop'), which clearly separates it from get_stop, get_vehicles, and the other siblings. It doesn't explicitly name an alternative tool to route away to, but the resource is unambiguous.

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

Usage Guidelines3/5

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

The description implies the use case (fetching arrivals for a stop) but gives no explicit when-to-use vs when-not guidance and never references sibling tools like get_stop or get_vehicles. The fallback explanation is behavioral rather than selection guidance.

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