Next Transit Departures
transit_next_departuresGet real-time departure predictions for a transit stop, showing minutes until the next bus or train and the expected clock time. Filter by line or limit results to know exactly when the next vehicle arrives.
Instructions
Live arrival predictions for the next vehicles at a stop.
This is the tool for "when is my next train/bus". It returns real-time predictions, not the printed timetable, and reports minutes-from-now alongside Pacific clock time.
Args:
operator_id (string): agency code from transit_list_operators, e.g. 'BA', 'SF'
stop_code (string): stop code from transit_find_stops. Codes belong to ONE operator and are not interchangeable between agencies
line (string): only departures on this line, matched on name or id
limit (number): maximum departures to return (default: 10)
response_format ('markdown' | 'json'): output format (default: 'markdown')
Returns: { "count": number, "total": number, "truncated": boolean, "operator": string, "stop_code": string, "stop_name": string, "retrieved_at": string, "departures": [ { "line": string, "destination": string, "expected": string, "aimed": string, "minutes": number, "vehicle": string | null, "at_stop": boolean } ] }
Examples:
"When's the next N Judah?" -> operator_id='SF', stop_code from transit_find_stops, line='N'
"Next BART from Downtown Berkeley?" -> operator_id='BA', the stop's code
Don't use when: you want the scheduled timetable rather than live predictions
Error Handling:
An empty result usually means service has ended for the night, or the stop is a route's final stop — 511 omits arrival-only terminals from this feed
Predictions extend roughly 90 minutes ahead; nothing beyond that appears
Rows reading "scheduled only, no live prediction" have no vehicle assigned yet
511 allows 60 requests per hour across ALL endpoints — never poll this in a loop
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | Only departures on this line, matched against the line name or id | |
| limit | No | Maximum results to return (max 200) | |
| stop_code | Yes | Stop code from transit_find_stops. Codes are specific to one operator | |
| operator_id | Yes | Operator code from transit_list_operators, e.g. 'BA' for BART, 'SF' for Muni | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| total | Yes | ||
| operator | No | ||
| stop_code | No | ||
| stop_name | No | ||
| truncated | Yes | ||
| departures | Yes | ||
| retrieved_at | No |