Skip to main content
Glama

Get Real-Time Arrivals

onebusaway_get_arrivals
Read-only

Real-time arrivals and departures at a stop. Returns predicted arrival times, schedule deviation (how many seconds late/early), vehicle positions, and any active service alerts. The predicted boolean on each arrival indicates whether GPS tracking backs the estimate — predicted=false means schedule-only. Use tripId from results for follow-up onebusaway_get_trip calls. Stop IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_75403").

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": {
      "stopId": "<stopId>"
    },
    "name": "onebusaway_get_arrivals"
  }
}

Input Schema

NameRequiredDescriptionDefault
stopIdYesAgency-prefixed stop ID (e.g. "1_75403" for Metro Transit stop 75403). Use onebusaway_find_stops or onebusaway_search_stops to discover IDs.
minutesAfterNoInclude arrivals expected within the next N minutes — an integer from 0 to 240. Defaults to 35. For a longer horizon, use onebusaway_get_schedule_for_stop.
minutesBeforeNoInclude arrivals that departed up to this many minutes ago — an integer from 0 to 60. Defaults to 5.

Output Schema

NameRequiredDescriptionDefault
countNoNumber of arrivals in the time window.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when no arrivals were found — widen minutesAfter, or check onebusaway_get_schedule_for_stop for scheduled service.
stopIdNoThe queried stop ID.
arrivalsNoArrivals and departures at this stop within the requested time window.
stopNameNoStop name.
timezoneNoValidated timezone of the queried stop agency, or UTC when unavailable or invalid.
situationsNoActive service alerts at this stop — those attached to the stop itself and those referenced by its arrivals, each listed once.
currentTimeNoServer time as Unix milliseconds, for computing countdown timers.
queriedStopNoStop ID queried.
windowMinutesNoTime window used for the arrivals query.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "stopId",
      -      "stopName",
      -      "currentTime",
      -      "arrivals",
      -      "situations",
      -      "queriedStop",
      -      "count",
      -      "windowMinutes"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "timezone",
      +      "stopId",
      +      "stopName",
      +      "currentTime",
      +      "arrivals",
      +      "situations",
      +      "queriedStop",
      +      "count",
      +      "windowMinutes"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / situations / items / properties / timezone
      Added value: +{
      +  "description": "Validated timezone shared by all affected scopes, otherwise UTC.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / situations / items / required
      Previous value: -[
      -  "id",
      -  "summary",
      -  "description"
      -]New value: +[
      +  "id",
      +  "timezone",
      +  "summary",
      +  "description"
      +]
    • addedOutput schema / properties / timezone
      Added value: +{
      +  "description": "Validated timezone of the queried stop agency, or UTC when unavailable or invalid.",
      +  "type": "string"
      +}
  2. Changed10 schema fields changed
    • changedInput schema / properties / minutesAfter / description
      Previous value: -"Include arrivals expected within the next N minutes. Defaults to 35."New value: +"Include arrivals expected within the next N minutes — an integer from 0 to 240. Defaults to 35. For a longer horizon, use onebusaway_get_schedule_for_stop."
    • addedInput schema / properties / minutesAfter / maximum
      Added value: +240
    • addedInput schema / properties / minutesAfter / minimum
      Added value: +0
    • changedInput schema / properties / minutesAfter / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / minutesBefore / description
      Previous value: -"Include arrivals that departed up to this many minutes ago. Defaults to 5."New value: +"Include arrivals that departed up to this many minutes ago — an integer from 0 to 60. Defaults to 5."
    • addedInput schema / properties / minutesBefore / maximum
      Added value: +60
    • addedInput schema / properties / minutesBefore / minimum
      Added value: +0
    • changedInput schema / properties / minutesBefore / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no arrivals were found — e.g. try expanding the time window or check for service alerts."New value: +"Guidance when no arrivals were found — widen minutesAfter, or check onebusaway_get_schedule_for_stop for scheduled service."
    • changedOutput schema / properties / situations / description
      Previous value: -"Active service alerts referenced by arrivals at this stop."New value: +"Active service alerts at this stop — those attached to the stop itself and those referenced by its arrivals, each listed once."
  3. Changed9 schema fields changed
    • removedOutput schema / properties / arrivals / items / properties / predictedArrivalTime / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / arrivals / items / properties / predictedArrivalTime / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / arrivals / items / properties / stopsAway / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / arrivals / items / properties / stopsAway / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / arrivals / items / properties / vehicleId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / arrivals / items / properties / vehicleId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `stop_not_found`: Stop ID does not exist on this instance. `rate_limited`: API returned a rate limit response. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `stop_not_found`: Stop ID does not exist on this instance. `rate_limited`: No upstream request slot opened within the queue wait cap, or OneBusAway returned a rate limit response. Other values are possible when a failure originates below the handler."
    • removedOutput schema / properties / situations / items / properties / description / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / situations / items / properties / description / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  4. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "stopId",
      +      "stopName",
      +      "currentTime",
      +      "arrivals",
      +      "situations",
      +      "queriedStop",
      +      "count",
      +      "windowMinutes"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `stop_not_found`: Stop ID does not exist on this instance. `rate_limited`: API returned a rate limit response. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "stop_not_found",
      +            "rate_limited"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "stopId",
      -  "stopName",
      -  "currentTime",
      -  "arrivals",
      -  "situations",
      -  "queriedStop",
      -  "count",
      -  "windowMinutes"
      -]
  5. Changed5 schema fields changed
    • addedOutput schema / properties / count
      Added value: +{
      +  "description": "Number of arrivals in the time window.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no arrivals were found — e.g. try expanding the time window or check for service alerts.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / queriedStop
      Added value: +{
      +  "description": "Stop ID queried.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / windowMinutes
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Time window used for the arrivals query.",
      +  "properties": {
      +    "after": {
      +      "description": "Minutes after current time included.",
      +      "type": "number"
      +    },
      +    "before": {
      +      "description": "Minutes before current time included.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "before",
      +    "after"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "stopId",
      -  "stopName",
      -  "currentTime",
      -  "arrivals",
      -  "situations"
      -]New value: +[
      +  "stopId",
      +  "stopName",
      +  "currentTime",
      +  "arrivals",
      +  "situations",
      +  "queriedStop",
      +  "count",
      +  "windowMinutes"
      +]
  6. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only safety, and the description adds genuinely non-obvious semantics: predicted=false means schedule-only rather than GPS-backed, and deviation is expressed in seconds late/early. It stops short of 5 because it says nothing about rate limits, caching/staleness of real-time data, or what an empty result means.

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?

Four tight sentences, front-loaded with what the tool returns, then semantics of the tricky field, then chaining and ID format. No filler, though the ID-format sentence partially duplicates the schema.

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?

With an output schema present, the description only needs to orient the agent — and it covers the return payload's meaning (including the non-obvious predicted flag), follow-up chaining, and ID format for a 3-parameter, fully described tool. Nothing needed to call it correctly 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 description coverage is 100%, so stopId format and the minutesBefore/minutesAfter windows are already fully documented in the schema. The description's restatement of the {agencyId}_{localId} format and the tripId field name adds little beyond what structured data provides; 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?

States a concrete verb+resource ('Real-time arrivals and departures at a stop') and immediately enumerates what comes back: predicted times, schedule deviation, vehicle positions, alerts. The word 'Real-time' plus the departure/deviation detail distinguishes it from the schedule-oriented siblings without needing the schemas.

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

Usage Guidelines4/5

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

Gives clear operational context: use tripId from results to chain into onebusaway_get_trip, and the agency-prefixed stop ID format. It does not name when to prefer this over onebusaway_get_schedule_for_stop (that routing hint lives only in the schema's minutesAfter description), so it stops short of explicit alternatives/exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.