Get nearby bus stops
bus_get_nearby_stopsFind nearby bus stops and check exact arrival times for approaching buses.
Instructions
List bus stops near a WGS-84 GPS coordinate, each annotated with the lines that pass through and the realtime buses approaching.
If you don't have coordinates: call bus_get_my_location first (city-level precision via IP), or ask the user for a landmark and resolve it via bus_search.pois — the resulting lat/lng goes into this tool's lat/lng args.
Args:
city_id (string, required): e.g. '034'
lat / lng (string, required): WGS-84 decimal coordinates
limit (number, default 5): how many of the closest stops to return (max 20)
response_format ('markdown' | 'json')
Returns (json): { "stops": [ { "sId": "021-15232", "sn": "西藏中路", "distance": 87, "isSubway": false, "physicalStId": "...", "namesakeStId": "...", "firstLineId": "...", "lines": [ { "lineId": "...", "name": "71", "direction": 0, "endSn": "...", "status": "等待发车" | "不在运营时间" | "" (running), "preArrivalTime": "10:10" | undefined, "targetOrder": 2, "targetStationId": "021-15232", "buses": [ { "busId": "...", "order": 2, "arrivalTime": 1779070466055, "travelTime": 25, "distanceToDest": 90, "capacity": 0 } ] } ], "subwayLines": [ { "name": "地铁2号线", "shortName": "2号线", "color": "140,194,32", "directions": [{ "destName": "...", "firstTime": "05:31", "lastTime": "23:24" }] } ] } ] }
Field notes:
buses[].arrivalTime is a ms timestamp; -1 = unknown
buses[].travelTime is seconds remaining; -1 = unknown
buses[].capacity: 0=light, 1=moderate, 2=crowded
If no realtime buses but the line is starting soon, 'preArrivalTime' will hold the next predicted dispatch ("10:12")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city_id | Yes | City ID, e.g. '034' | |
| lat | Yes | WGS-84 latitude | |
| lng | Yes | WGS-84 longitude | |
| limit | No | How many of the nearest stops to return. Default 5 — the upstream may return 15+ and most callers only care about the closest few. | |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |