Skip to main content
Glama

Plan a public-transit route

bus_plan_transit
Read-onlyIdempotent

Plan 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

TableJSON Schema
NameRequiredDescriptionDefault
city_idYes
origin_nameYesOrigin display name
origin_latYesOrigin latitude in GCJ-02
origin_lngYesOrigin longitude in GCJ-02
dest_nameYesDestination display name
dest_latYesDestination latitude in GCJ-02
dest_lngYesDestination longitude in GCJ-02
strategyNoRouting 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_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?

Annotations already show readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds crucial behavioral context: coordinate system GCJ-02, return format, line types (0=bus,1=metro), duration/distance units, and a note field for suspicious responses. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections: purpose, coordinate note, args, return example. Front-loaded with core purpose. Every sentence adds value, though length could be slightly reduced.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 9 parameters and no output schema, the description is thorough: covers all params, return shape, edge cases (strategy 3, coordinate conversion). Lacks error handling details, but acceptable.

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

Parameters4/5

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

Schema coverage is high (89%). The description adds meaningful context beyond schema: explains coordinate system origin, strategy nuances (3=bus-only), and default behavior. Includes a return example that clarifies parameter usage.

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 it plans a public-transit route between two points and returns alternative plans. It distinguishes itself from sibling tools like bus_search (which searches stations/POIs) and bus_get_line_* (line details) by focusing on route planning with segments.

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 clear context on when to use: for planning transit routes. Advises on coordinate conversion and strategy selection (recommending 0 for most cases). Does not explicitly list when not to use, but sibling list and purpose make it clear.

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