Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HOSTNoHTTP transport bind host127.0.0.1
PORTNoHTTP transport bind port3000
TRANSPORTNostdio or httpstdio
ALLOWED_ORIGINSNoComma-separated origin allowlistlocalhost and claude.ai
MCP_PATH_SECRETNoServes the endpoint at /mcp/<secret>. Required when HOST is not loopback
TRANSIT_511_API_KEYYesToken from https://511.org/open-data/token
TRANSIT_511_BASE_URLNoOverride the API hosthttps://api.511.org
TRANSIT_511_REQUEST_TIMEOUT_MSNoPer-request timeout30000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
transit_list_operatorsA

List Bay Area transit agencies and their operator codes.

Start here. Every other tool needs an operator code, and this is what produces them — BART is 'BA', Muni is 'SF', AC Transit is 'AC', Caltrain is 'CT'.

The Monitored flag matters: agencies reporting real-time data support live departures and vehicle positions, while schedule-only agencies do not.

Args:

  • monitored_only (boolean): only agencies publishing real-time data (default: false)

  • limit (number): maximum operators to return (default: 50)

  • response_format ('markdown' | 'json'): output format (default: 'markdown')

Returns: { "count": number, "total": number, "truncated": boolean, "operators": [ { "Id": string, "Name": string, "Monitored": boolean, "PrimaryMode": string, "TimeZone": string } ] }

Examples:

  • "What transit agencies are there?" -> call with no arguments

  • "Which ones have live tracking?" -> monitored_only=true

  • Call this first whenever the user names an agency, to resolve its code

Error Handling:

  • Ignore the TimeZone field: 511 reports "America/Vancouver" for every Bay Area agency, which is a known upstream data bug. Everything here is Pacific time

  • 511-internal pseudo-agencies (5E, 5F, 5O, 5S) are filtered out — they carry no service data

  • 511 allows 60 requests per hour across ALL endpoints, so cache this rather than re-fetching

transit_list_linesA

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

transit_find_stopsA

Find an agency's stops by name, and get the stop codes the real-time tools need.

This is the bridge between "Downtown Berkeley" and the code transit_next_departures wants. Pass a query: a large agency has thousands of stops, and 511 returns all of them in one unpaginated response.

Args:

  • operator_id (string): agency code from transit_list_operators

  • query (string): substring match on the stop name — strongly recommended

  • limit (number): maximum stops to return (default: 25)

  • response_format ('markdown' | 'json'): output format (default: 'markdown')

Returns: { "count": number, "total": number, "truncated": boolean, "stops": [ { "id": string, "Name": string, "Location": { "Latitude": string, "Longitude": string } } ] }

Examples:

  • "When's the next train from Downtown Berkeley?" -> operator_id='BA', query='downtown berkeley', then pass the id to transit_next_departures

  • "Find Muni stops on Judah" -> operator_id='SF', query='judah'

  • Don't use when: you already have the stop code

Error Handling:

  • Stop codes belong to ONE operator and are not interchangeable between agencies

  • Filtering happens on this server, so a narrow query does not save quota — the full list is fetched either way

  • 511 allows 60 requests per hour across ALL endpoints

transit_next_departuresA

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

transit_list_vehiclesA

Live positions of an agency's vehicles currently in service.

Answers "where are the trains right now" and "how many buses are running on this line". For "when does one get to me", use transit_next_departures instead.

Args:

  • operator_id (string): agency code from transit_list_operators

  • line (string): only vehicles on this line, matched on name or id

  • limit (number): maximum vehicles to return (default: 25)

  • response_format ('markdown' | 'json'): output format (default: 'markdown')

Returns: { "count": number, "total": number, "truncated": boolean, "vehicles": [ { "line": string, "vehicle": string, "destination": string, "latitude": number | null, "longitude": number | null, "bearing": number | null, "recorded_at": string } ] }

Examples:

  • "How many Muni trains are running on the N?" -> operator_id='SF', line='N'

  • "Where are the BART trains?" -> operator_id='BA'

  • Don't use when: you want arrival times at a stop (use transit_next_departures)

Error Handling:

  • Coordinates arrive as strings and may be empty; those vehicles report "position unavailable" rather than a false 0,0

  • An agency with no real-time feed returns nothing — check Monitored in transit_list_operators

  • 511 allows 60 requests per hour across ALL endpoints

transit_list_service_alertsA

Service alerts — delays, outages, detours and planned disruptions.

Answers "is BART running normally", "why is my line delayed" and "anything I should know before I leave". Omit operator_id to sweep every Bay Area agency in a single request, which is also the kinder option against the hourly quota.

Args:

  • operator_id (string): limit to one agency; omit for all operators

  • query (string): substring match on the headline or description

  • active_only (boolean): only alerts whose active period covers now (default: true)

  • limit (number): maximum alerts to return (default: 25)

  • response_format ('markdown' | 'json'): output format (default: 'markdown')

Returns: { "count": number, "total": number, "truncated": boolean, "alerts": [ { "id": string, "header": string, "description": string, "effect": string, "cause": string, "routes": [string], "start": number, "end": number } ] // epoch SECONDS }

Examples:

  • "Any BART delays?" -> operator_id='BA'

  • "Anything wrong on my commute?" -> omit operator_id, read across agencies

  • "Weekend track work?" -> active_only=false, query='weekend'

  • Don't use when: you want a specific stop's arrivals (use transit_next_departures)

Error Handling:

  • No alerts is genuinely good news, not an error — it means normal service

  • Timestamps here are epoch seconds, unlike the ISO strings elsewhere in this API

  • Setting active_only=false surfaces future planned work as well as current problems

  • 511 allows 60 requests per hour across ALL endpoints

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RyK57/transit-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server