Get realtime buses for a (line, stop) pair
bus_get_line_realtimeReturns all buses currently on a line plus the nearest bus's ETA to a selected waiting stop, using city, line, stop order, station ID, and location.
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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"city_id": "<city_id>",
"line_id": "<line_id>",
"target_order": "<target_order>",
"station_id": "<station_id>",
"lat": "<lat>",
"lng": "<lng>"
},
"name": "bus_get_line_realtime"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | WGS-84 latitude. If the user's location is unknown, fall back to the waiting stop's lat (from line_detail.stations[].wgsLat). | |
| lng | Yes | WGS-84 longitude. Fallback to the stop's wgsLng if unknown. | |
| city_id | Yes | ||
| line_id | Yes | ||
| station_id | Yes | sId of the waiting stop | |
| target_order | Yes | Order 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. | |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |