List Transit Lines
transit_list_linesList transit agency routes and look up line names to get their IDs for real-time data queries.
Instructions
List an agency's routes.
Use this to resolve a line name a user mentions into the id the real-time tools filter on, or to answer "what routes does this agency run".
Args:
operator_id (string): agency code from transit_list_operators
query (string): substring match on the line name or public code
limit (number): maximum lines to return (default: 25)
response_format ('markdown' | 'json'): output format (default: 'markdown')
Returns: { "count": number, "total": number, "truncated": boolean, "lines": [ { "Id": string, "Name": string, "PublicCode": string, "TransportMode": string, "Monitored": boolean } ] }
Examples:
"What BART lines are there?" -> operator_id='BA'
"Is there an N line on Muni?" -> operator_id='SF', query='N'
Don't use when: you want stops on a line (use transit_find_stops)
Error Handling:
A large agency returns many lines; use query to narrow rather than raising limit
511 allows 60 requests per hour across ALL endpoints
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results to return (max 200) | |
| query | No | Case-insensitive substring match on the line name or public code | |
| 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 | ||
| lines | Yes | ||
| total | Yes | ||
| truncated | Yes |