Skip to main content
Glama

Get Real-Time Vehicle Positions

onebusaway_get_vehicles
Read-only

Real-time positions of active vehicles for an agency. Optionally filter to a single route (client-side). Returns GPS coordinates, counter-clockwise orientation from east, schedule deviation, and current trip. Reports agency records omitted for missing position coordinates. Use agencyId values from onebusaway_list_agencies.

Input 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

NameRequiredDescriptionDefault
countNoNumber of vehicles returned after any route filter.
errorNoPresent when the call failed. Absent on success.
noticeNoIndependent notices for records omitted without position, upstream truncation, and an empty returned list.
routeIdNoRoute ID filter applied client-side, if any.
agencyIdNoAgency ID queried.
timezoneNoValidated timezone of the requested agency, or UTC when unavailable or invalid.
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.
omittedWithoutPositionNoAgency-wide records omitted because latitude or longitude is missing, counted before route filtering.
omittedWithoutPositionOnRouteNoOmitted records whose canonical current trip resolves to the requested route; present only with a route filter.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "vehicles",
      -      "limitExceeded",
      -      "agencyId",
      -      "count"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "timezone",
      +      "omittedWithoutPosition",
      +      "vehicles",
      +      "limitExceeded",
      +      "agencyId",
      +      "count"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no vehicles were found — e.g. the route may not be currently active, or the agency may not have real-time data."New value: +"Independent notices for records omitted without position, upstream truncation, and an empty returned list."
    • addedOutput schema / properties / omittedWithoutPosition
      Added value: +{
      +  "description": "Agency-wide records omitted because latitude or longitude is missing, counted before route filtering.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / omittedWithoutPositionOnRoute
      Added value: +{
      +  "description": "Omitted records whose canonical current trip resolves to the requested route; present only with a route filter.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / timezone
      Added value: +{
      +  "description": "Validated timezone of the requested agency, or UTC when unavailable or invalid.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / vehicles / items / properties / orientation / description
      Previous value: -"Heading in degrees (0=north, 90=east), or null."New value: +"Counter-clockwise degrees from east (0=east, 90=north, 180=west, 270=south), not a compass bearing; null if unavailable."
    • changedOutput schema / properties / vehicles / items / properties / tripId / description
      Previous value: -"Current trip ID, or null if not on a trip."New value: +"Active trip ID, falling back to the vehicle trip ID when absent; null if neither is available. All trip metadata resolves only from this ID."
  2. 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"
      +]
  3. 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"
      -]
  4. 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"
      +]
  5. 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"
      +]
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With annotations only declaring readOnlyHint, the description adds meaningful behavior: route filtering is client-side, all agency vehicles are fetched first, and records missing coordinates are omitted. It does not mention rate limits or pagination, but the output schema exists and the safety profile is already covered by annotations.

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 front-loaded with the tool purpose, then compactly covers filtering behavior, returned fields, omission handling, and ID sourcing. Every sentence contributes useful context without unnecessary repetition.

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?

Given the output schema handles return structure and annotations cover read-only safety, the description supplies the remaining critical context: required agencyId discovery, optional route filtering behavior, and the caveat that some records may be omitted. Nothing essential 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 description coverage is 100%, so the baseline is 3. The description reinforces the optional route filter and agencyId source, but those details are already present in the schema; it does not add syntax or meaning beyond the structured parameter descriptions.

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 active vehicles for an agency, with route filtering scope. It distinguishes itself from sibling tools like arrivals, trips, and stops by focusing on GPS-based vehicle positions, so an agent can identify it without opening the schema.

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?

It gives a clear prerequisite by directing the agent to onebusaway_list_agencies for agencyId and explains the optional route filter. However, it does not explicitly compare when to use this tool versus alternatives such as onebusaway_get_arrivals or onebusaway_get_trip, so it falls short of full when/when-not guidance.

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.