Skip to main content
Glama

Get realtime buses for a (line, stop) pair

bus_get_line_realtime
Read-onlyIdempotent

Retrieve real-time bus arrivals for a specific line and waiting stop, including ETA of the nearest bus and positions of all buses on the line.

Instructions

Canonical "when will my bus arrive" tool. Returns every bus currently on the line, with the nearest one carrying an ETA to the waiting stop.

Important: the upstream predicts an ETA for only the nearest bus heading to your stop. Buses farther up the route are returned (with position/speed/capacity) but their eta field is null. That's not a bug.

Args:

  • city_id (string, required)

  • line_id (string, required): from bus_search

  • target_order (string, required): the waiting stop's order on the line. Source: bus_get_line_detail.stations[i].order, or bus_get_nearby_stops.stops[].lines[].targetOrder.

  • station_id (string, required): sId of the waiting stop

  • lat / lng (string, required): WGS-84 — the user's location is best; if unavailable, use the waiting stop's wgsLat/wgsLng (from line_detail.stations[i]).

  • response_format ('markdown' | 'json')

Returns (json): { "line": { "lineId":"...", "name":"71", "direction":0, "endSn":"..." }, "targetOrder": 2, "realData": true, "buses": [ { "busId":"...", "licence":"...", "order":2, "lat":..., "lng":..., "speed":5.7, "capacity":0, "distanceToWaitStn":90, "eta":{"travelTime":25,"arrivalTime":1779070466055,"displayTime":"10:14"} }, { "busId":"...", "order":3, "lat":..., "lng":..., "speed":3, "capacity":0, "eta":null }, ... ], "note": "..." }

Field notes:

  • The 'line' sub-object intentionally omits startSn — upstream does not return it on this endpoint. Read it from bus_get_line_detail if needed.

  • eta.travelTime is seconds remaining

  • eta.arrivalTime is a ms timestamp

  • eta.displayTime is a "HH:MM" hint from upstream

  • capacity: 0=light, 1=moderate, 2=crowded

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
city_idYes
line_idYes
target_orderYesOrder index of the waiting stop on the line. Get it from bus_get_line_detail.stations[].order or bus_get_nearby_stops.stops[].lines[].targetOrder.
station_idYessId of the waiting stop
latYesWGS-84 latitude. If the user's location is unknown, fall back to the waiting stop's lat (from line_detail.stations[].wgsLat).
lngYesWGS-84 longitude. Fallback to the stop's wgsLng if unknown.
response_formatNoOutput format: 'markdown' for human-readable text, 'json' for full structured datamarkdown
Behavior5/5

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

The description discloses the behavioral trait that only the nearest bus has ETA while others have null, explaining this is not a bug. Annotations already indicate read-only and idempotent, and the description adds extensive detail on output structure and edge cases.

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 well-structured with a clear purpose, important note, argument list, output example, and field notes. Every section adds value, and there is no redundant or wasted text.

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?

Given the complexity (7 parameters, realtime data, no output schema), the description is highly complete. It explains parameter construction, output fields, caveats, and references sibling tools for data sources, making it sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema for all parameters, e.g., sourcing guidance for line_id and target_order, fallback instructions for lat/lng, and explanation of response_format. This compensates for the 71% 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 tool's purpose as the canonical 'when will my bus arrive' tool, specifying it returns realtime buses with ETA for the nearest bus. This distinguishes it from siblings like bus_get_timetable (schedule) and bus_list_line_buses.

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?

Provides an important caveat about ETA only for the nearest bus and gives fallback guidance for lat/lng parameters. However, it lacks explicit direction on when to use this vs alternatives; the context and sibling names imply the appropriate use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/PeanutSplash/chelaile-mcp'

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