Skip to main content
Glama

Get Route Schedule

onebusaway_get_schedule_for_route
Read-only

Full-day schedule for a route — all trips, stop sequences, and departure times for the specified date (defaults to today). Optionally select an exact tripId or complete trips having any departure in a half-open GTFS-seconds interval; selection includes counts before and after filtering. Without selectors, returns all mapped trips with no default cap. For live predictions, use onebusaway_get_arrivals at specific stops instead.

Input Schema

NameRequiredDescriptionDefault
dateNoService date as YYYY-MM-DD (e.g. "2026-05-23"). Must be a real calendar date. Omit or leave blank for today.
tripIdNoExact trip ID; omit or leave blank for no trip selector. Mutually exclusive with departure bounds.
routeIdYesAgency-prefixed route ID (e.g. "1_100259"). Use onebusaway_find_routes or onebusaway_search_routes to discover IDs.
departureFromSecNoInclusive departure lower bound in GTFS seconds from midnight; values beyond 86400 are valid.
departureBeforeSecNoExclusive departure upper bound in GTFS seconds from midnight; must exceed departureFromSec when both are supplied.

Output Schema

NameRequiredDescriptionDefault
dateNoDate parameter used for the schedule request, if specified.
errorNoPresent when the call failed. Absent on success.
tripsNoAll trips for this route on this date, with their stop sequences.
noticeNoGuidance when no trips were found — e.g. no service on weekends or holiday schedule in effect.
routeIdNoThe queried route ID.
timezoneNoValidated timezone of the referenced route agency, or UTC when unavailable or invalid.
selectionNoApplied selectors and trip counts before and after local selection; absent without selectors.
tripCountNoNumber of trips for this route on this date.
queriedRouteNoRoute ID queried.
serviceDateMsNoUnchanged upstream service-date marker (scheduleDate) as Unix milliseconds, identifying the route schedule service day.
routeShortNameNoRoute short name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / departureBeforeSec
      Added value: +{
      +  "description": "Exclusive departure upper bound in GTFS seconds from midnight; must exceed departureFromSec when both are supplied.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / departureFromSec
      Added value: +{
      +  "description": "Inclusive departure lower bound in GTFS seconds from midnight; values beyond 86400 are valid.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / tripId
      Added value: +{
      +  "description": "Exact trip ID; omit or leave blank for no trip selector. Mutually exclusive with departure bounds.",
      +  "type": "string"
      +}
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "routeId",
      -      "routeShortName",
      -      "serviceDateMs",
      -      "trips",
      -      "queriedRoute",
      -      "tripCount"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "timezone",
      +      "routeId",
      +      "routeShortName",
      +      "serviceDateMs",
      +      "trips",
      +      "queriedRoute",
      +      "tripCount"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / selection
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Applied selectors and trip counts before and after local selection; absent without selectors.",
      +  "properties": {
      +    "departureBeforeSec": {
      +      "description": "Exclusive departure upper bound in GTFS seconds from midnight; must exceed departureFromSec when both are supplied.",
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "departureFromSec": {
      +      "description": "Inclusive departure lower bound in GTFS seconds from midnight; values beyond 86400 are valid.",
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "returned": {
      +      "description": "Count after local selection.",
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "total": {
      +      "description": "Count before local selection.",
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "tripId": {
      +      "description": "Exact trip ID; omit or leave blank for no trip selector. Mutually exclusive with departure bounds.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "total",
      +    "returned"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / properties / serviceDateMs / description
      Previous value: -"Service date as Unix milliseconds."New value: +"Unchanged upstream service-date marker (scheduleDate) as Unix milliseconds, identifying the route schedule service day."
    • addedOutput schema / properties / timezone
      Added value: +{
      +  "description": "Validated timezone of the referenced route agency, or UTC when unavailable or invalid.",
      +  "type": "string"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / date / anyOf
      Added value: +[
      +  {
      +    "const": "",
      +    "type": "string"
      +  },
      +  {
      +    "description": "A real calendar date in YYYY-MM-DD form (e.g. \"2026-05-23\").",
      +    "format": "date",
      +    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / date / description
      Previous value: -"ISO 8601 date (e.g. \"2026-05-23\"). Defaults to today."New value: +"Service date as YYYY-MM-DD (e.g. \"2026-05-23\"). Must be a real calendar date. Omit or leave blank for today."
    • removedInput schema / properties / date / type
      Removed value: -"string"
  3. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `route_not_found`: Route 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: `route_not_found`: Route 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: -[
      -  "route_not_found"
      -]New value: +[
      +  "route_not_found",
      +  "rate_limited"
      +]
  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": [
      +      "routeId",
      +      "routeShortName",
      +      "serviceDateMs",
      +      "trips",
      +      "queriedRoute",
      +      "tripCount"
      +    ]
      +  },
      +  {
      +    "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: `route_not_found`: Route ID does not exist on this instance. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "route_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: -[
      -  "routeId",
      -  "routeShortName",
      -  "serviceDateMs",
      -  "trips",
      -  "queriedRoute",
      -  "tripCount"
      -]
  5. Changed5 schema fields changed
    • addedOutput schema / properties / date
      Added value: +{
      +  "description": "Date parameter used for the schedule request, if specified.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no trips were found — e.g. no service on weekends or holiday schedule in effect.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / queriedRoute
      Added value: +{
      +  "description": "Route ID queried.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / tripCount
      Added value: +{
      +  "description": "Number of trips for this route on this date.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "routeId",
      -  "routeShortName",
      -  "serviceDateMs",
      -  "trips"
      -]New value: +[
      +  "routeId",
      +  "routeShortName",
      +  "serviceDateMs",
      +  "trips",
      +  "queriedRoute",
      +  "tripCount"
      +]
  6. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations cover the read-only safety profile, and the description adds real behavioral facts: no default cap on results without selectors, mutually exclusive selectors, and that counts before and after filtering are included. It stops short of warning about payload size or pagination for the uncapped full-day case.

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?

Two dense sentences with the resource purpose front-loaded and the alternative tool named last, which is the right order. No wasted clauses, though the selector sentence packs several concepts into one long construction.

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 and full parameter coverage, the description only needed to supply selection semantics, defaulting behavior, and routing to alternatives, all of which it does. Nothing required to invoke it correctly is missing.

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 baseline is 3, but the description adds meaning beyond the schema: it explains that selectors are optional, that selecting yields counts before and after filtering, and that unfiltered calls return everything with no cap. The half-open GTFS-seconds semantics are already in the schema.

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 specific verb and resource ("Full-day schedule for a route") and enumerates exactly what is returned (all trips, stop sequences, departure times) plus the date default. This clearly separates it from onebusaway_get_schedule_for_stop and onebusaway_get_arrivals.

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?

Explicitly routes the agent away from live data with "For live predictions, use onebusaway_get_arrivals at specific stops instead," and describes when the optional selectors apply. It does not mention onebusaway_get_schedule_for_stop as the stop-scoped alternative, leaving one sibling comparison to inference.

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.