Skip to main content
Glama

Get STPT service alerts

get_alerts
Read-onlyIdempotent

Retrieve current or historical STPT service alerts, filtered by stop ID or line. Returns only alerts active at the current instant when active_only is enabled.

Instructions

Get current or historical STPT service alerts. Filters by stop ID and/or line when supplied. Active periods are evaluated in Europe/Bucharest.

Input Schema

NameRequiredDescriptionDefault
lineNoOptional line filter.
limitNoMaximum number of alerts.
stop_idNoOptional STPT stop ID.
active_onlyNoReturn only alerts active at the current instant.

Output Schema

NameRequiredDescriptionDefault
lineNo
countYes
errorNoStructured failure, if any.
alertsNo
statusYesOverall result status.
stop_idNo
provenanceNoSource and freshness metadata.
active_onlyYes

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.8/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, so the safety profile is covered. The description adds genuinely useful non-obvious context: that active-period evaluation happens in Europe/Bucharest and that both current and historical alerts are returned. It stops short of noting data freshness or rate limits.

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?

Two tight sentences, front-loaded with the core action, and the timezone note earns its place as non-obvious behavior. No filler.

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

Completeness4/5

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

With an output schema, full schema coverage, and rich annotations, the description covers what the agent needs to call it correctly. Only the sibling relationship to get_service_status is unaddressed, which is a minor gap.

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 four parameters are already documented. The description reinforces that line and stop_id are optional filters ('when supplied') and adds timezone context for active_only, but supplies no format or semantics the schema lacks. 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 ... STPT service alerts') and clarifies the current-vs-historical scope. It is distinguishable from most siblings like get_arrivals or get_vehicles, though it never explicitly contrasts with get_service_status, which is the nearest sibling and could be confused with it.

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?

'Filters by stop ID and/or line when supplied' implies how to narrow results but gives no explicit when-to-use guidance or exclusions relative to get_service_status or get_arrivals. The agent must infer that this is the tool for alert text as opposed to arrival/status data.

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