Skip to main content
Glama

Get Real-Time Vehicle Positions

onebusaway_get_vehicles
Read-only

Real-time positions of all active vehicles for an agency. Optionally filter to a single route (client-side). Returns GPS coordinates, heading, schedule deviation, and current trip. Useful for "where are all the buses on route X right now?" Use agencyId values from onebusaway_list_agencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routeIdNoOptional agency-prefixed route ID to filter results to one route. Filtering is client-side — all agency vehicles are fetched first.
agencyIdYesAgency ID (e.g. "1" for Metro Transit, "40" for Sound Transit). Use onebusaway_list_agencies to discover IDs.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of vehicles returned after any route filter.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when no vehicles were found — e.g. the route may not be currently active, or the agency may not have real-time data.
routeIdNoRoute ID filter applied client-side, if any.
agencyIdNoAgency ID queried.
vehiclesNoActive vehicles for the agency, optionally filtered by route.
limitExceededNoTrue if the upstream capped the vehicle list — some vehicles were omitted. This endpoint has no pagination to retrieve them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `agency_not_found`: Agency ID does not exist on this instance. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `agency_not_found`: Agency 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."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "agency_not_found"
      -]New value: +[
      +  "agency_not_found",
      +  "rate_limited"
      +]
    • removedOutput schema / properties / vehicles / items / properties / nextStop / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / nextStop / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / orientation / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / orientation / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / routeId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / routeId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / routeShortName / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / routeShortName / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / scheduleDeviation / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / scheduleDeviation / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / tripHeadsign / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / tripHeadsign / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / vehicles / items / properties / tripId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / vehicles / items / properties / tripId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. 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": [
      +      "vehicles",
      +      "limitExceeded",
      +      "agencyId",
      +      "count"
      +    ]
      +  },
      +  {
      +    "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: `agency_not_found`: Agency ID does not exist on this instance. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "agency_not_found"
      +          ],
      +          "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: -[
      -  "vehicles",
      -  "limitExceeded",
      -  "agencyId",
      -  "count"
      -]
  3. Changed2 schema fields changed
    • addedOutput schema / properties / limitExceeded
      Added value: +{
      +  "description": "True if the upstream capped the vehicle list — some vehicles were omitted. This endpoint has no pagination to retrieve them.",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "vehicles",
      -  "agencyId",
      -  "count"
      -]New value: +[
      +  "vehicles",
      +  "limitExceeded",
      +  "agencyId",
      +  "count"
      +]
  4. Changed5 schema fields changed
    • addedOutput schema / properties / agencyId
      Added value: +{
      +  "description": "Agency ID queried.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / count
      Added value: +{
      +  "description": "Number of vehicles returned after any route filter.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no vehicles were found — e.g. the route may not be currently active, or the agency may not have real-time data.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / routeId
      Added value: +{
      +  "description": "Route ID filter applied client-side, if any.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "vehicles"
      -]New value: +[
      +  "vehicles",
      +  "agencyId",
      +  "count"
      +]
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, so the safe-read nature is already captured. The description adds meaningful behavior beyond that: filtering is client-side (all agency vehicles are fetched first), and the tool returns GPS coordinates, heading, schedule deviation, and current trip. This gives the agent expectations about data volume and output content without contradicting the annotation.

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 compact and front-loaded: it states the core function, filter option, return content, a typical use case, and where to find agency IDs. Every sentence earns its place, with no redundancy or 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 present, the return structure does not need to be fully explained in the description. The description covers the required agencyId source, optional route filtering, and the nature of the data. Minor gaps such as pagination or data freshness are not critical because the output schema provides response detail and the tool is read-only.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already describes both parameters. The description adds value by giving example agency IDs ('1' for Metro Transit, '40' for Sound Transit) and by explicitly stating the route filter is client-side, meaning all vehicles are fetched before filtering. This helps an agent understand practical implications beyond the schema's basic field definitions.

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: 'Real-time positions of all active vehicles for an agency.' It clearly distinguishes itself from siblings by focusing on live vehicle positions, and lists concrete output fields (GPS coordinates, heading, schedule deviation, current trip). This is unique among the sibling tools, none of which cover real-time vehicle tracking.

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?

The description gives clear context by framing the tool as useful for 'where are all the buses on route X right now?' and explicitly directs the agent to get agencyId values from onebusaway_list_agencies. It also explains the optional route filter, including the client-side behavior. It does not explicitly name alternative tools or exclusions, but no sibling offers the same real-time vehicle capability, so the guidance is sufficient.

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.