Plan a public-transit route
bus_plan_transitPlan public transit routes combining bus and metro. Get recommended itineraries with walking and ride segments, customizable by strategy (fewest transfers, least walking, fastest time).
Instructions
Plan a public-transit (bus + metro) route between two points. Returns alternative plans sorted by recommendation, each broken into walking and ride segments.
Coordinate system: this tool expects GCJ-02. The easiest source is bus_search.pois[*].lat/lng — those are already GCJ-02 and carry a name. If you only have WGS-84 (e.g. from a phone GPS), convert it before calling.
Args:
city_id (string, required)
origin_name, origin_lat, origin_lng (string, required): origin in GCJ-02
dest_name, dest_lat, dest_lng (string, required): destination in GCJ-02
strategy ('0'|'1'|'2'|'3'): 0=recommended (default; surfaces metro), 1=fewest transfers, 2=least walking, 3=shortest time (BUS-ONLY — upstream often drops metro plans here, so for general "fastest route" questions use 0)
response_format ('markdown' | 'json')
Returns (json): { "origin": "lng,lat", "destination": "lng,lat", "distance": 17982, "plans": [ { "duration": 3056, "walkingDistance": 1466, "distance": 19086, "tag": "直达", "transitCount": 1, "segments": [ { "type": "walking", "distance": 837, "duration": 717 }, { "type": "bus", "name": "地铁2号线", "lineType": 1, "departureStop": "人民广场", "arrivalStop": "虹桥2号航站楼", "viaStops": 8, "duration": 1800, "distance": 17620, "startTime": "05:37", "endTime": "23:30" } ] } ] } lineType: 0=bus, 1=metro. Durations in seconds, distances in meters.
A top-level 'note' field is emitted when the response shape is suspicious — e.g. strategy=3 returned no metro plans despite this being a likely metro trip.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city_id | Yes | ||
| origin_name | Yes | Origin display name | |
| origin_lat | Yes | Origin latitude in GCJ-02 | |
| origin_lng | Yes | Origin longitude in GCJ-02 | |
| dest_name | Yes | Destination display name | |
| dest_lat | Yes | Destination latitude in GCJ-02 | |
| dest_lng | Yes | Destination longitude in GCJ-02 | |
| strategy | No | Routing strategy: 0=recommended (default; surfaces metro), 1=fewest transfers, 2=least walking, 3=shortest time among BUS-ONLY candidates (upstream often excludes metro from this strategy — when in doubt, use 0). For most user questions, 0 is the right choice. | 0 |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |