Skip to main content
Glama

List Routes for Agency

onebusaway_list_routes_for_agency
Read-only

List all routes operated by an agency. Returns route IDs, short names, and descriptions. Use to enumerate an agency's full service before searching for a specific route. Get agencyId values from onebusaway_list_agencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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 routes returned for this agency.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when no routes were found — verify the agency ID with onebusaway_list_agencies.
routesNoAll routes operated by this agency.
agencyIdNoAgency ID queried.
limitExceededNoTrue if the upstream capped the route list — some routes were omitted. This endpoint has no pagination to retrieve them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 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 / routes / items / properties / color / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / routes / items / properties / color / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / routes / items / properties / url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / routes / items / properties / url / 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": [
      +      "routes",
      +      "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: -[
      -  "routes",
      -  "limitExceeded",
      -  "agencyId",
      -  "count"
      -]
  3. Changed2 schema fields changed
    • addedOutput schema / properties / limitExceeded
      Added value: +{
      +  "description": "True if the upstream capped the route list — some routes were omitted. This endpoint has no pagination to retrieve them.",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "routes",
      -  "agencyId",
      -  "count"
      -]New value: +[
      +  "routes",
      +  "limitExceeded",
      +  "agencyId",
      +  "count"
      +]
  4. Changed1 schema field changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no routes were found — verify the agency ID with onebusaway_list_agencies.",
      +  "type": "string"
      +}
  5. Changed3 schema fields changed
    • addedOutput schema / properties / agencyId
      Added value: +{
      +  "description": "Agency ID queried.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / count
      Added value: +{
      +  "description": "Number of routes returned for this agency.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "routes"
      -]New value: +[
      +  "routes",
      +  "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?

Annotations already declare readOnlyHint=true, so the description doesn't need to repeat that. It adds behavioral context by stating it returns all routes ('full service') and specifying the return fields (route IDs, short names, descriptions). This goes beyond annotations by clarifying the scope and output shape, which helps the agent understand what to expect. No contradictions.

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 three sentences with no wasted words. It front-loads the core action, then states return fields, then gives usage context and a cross-reference. Each sentence serves a distinct purpose, and the structure is logical and easy to scan.

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?

For a simple tool with one parameter and an output schema, the description covers all essential aspects: what it does, what it returns, and how to obtain the required input. It is sufficiently complete for an agent to decide when to use it and how to invoke it correctly. The presence of an output schema means the description doesn't need to explain return details.

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?

The schema description for agencyId is fully descriptive (100% coverage), including examples and a pointer to onebusaway_list_agencies. The description repeats the cross-reference but does not add any new meaning beyond the schema. Since schema already covers the parameter, the description adds minimal value here, matching the baseline of 3 for high schema coverage.

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 clearly states the verb (list), the resource (routes), and the scope (per agency). It explicitly says 'List all routes operated by an agency' and distinguishes itself from searching tools by framing it as 'enumerate an agency's full service before searching for a specific route.' This differentiates it from siblings like onebusaway_find_routes and onebusaway_search_routes.

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 provides clear guidance on when to use the tool: to enumerate an agency's full service before searching for a specific route. It also gives an explicit cross-reference for obtaining the required parameter via onebusaway_list_agencies. However, it does not explicitly name the alternative search tools (e.g., onebusaway_search_routes), leaving some inference for the agent about which sibling to use for targeted searches.

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.