Skip to main content
Glama

Get nearby bus stops

bus_get_nearby_stops
Read-onlyIdempotent

Find 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

TableJSON Schema
NameRequiredDescriptionDefault
city_idYesCity ID, e.g. '034'
latYesWGS-84 latitude
lngYesWGS-84 longitude
limitNoHow many of the nearest stops to return. Default 5 — the upstream may return 15+ and most callers only care about the closest few.
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 indicate readOnlyHint=true and idempotentHint=true. The description adds rich behavioral context by detailing the return structure, field notes (e.g., 'buses[].arrivalTime is a ms timestamp', 'capacity: 0=light, 1=moderate, 2=crowded'), and real-time behavior. 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?

The description is lengthy but well-structured: purpose first, then usage guidance, then parameter explanation, then full return example with field notes. Every section adds value; no filler. Could be slightly more concise, but overall well-organized.

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?

Despite no output schema, the description provides a complete return schema with detailed field notes covering all return fields. It explains how to obtain coordinates, parameter specifics, and response format. For a tool with 5 params and complex output, this is thorough and fully contextual.

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 100%, so baseline is 3. The description adds extra semantics beyond the schema, e.g., 'limit: how many of the closest stops to return (max 20)' and response_format explanation. It also clarifies the city_id format. This lifts the score to 4.

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 explicitly states 'List bus stops near a WGS-84 GPS coordinate, each annotated with the lines that pass through and the realtime buses approaching.' This clearly defines the verb (list), resource (bus stops), and scope (near coordinates with lines/realtime), distinguishing it from siblings like bus_get_stop_detail (specific stop) and bus_search (by name).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: 'If you don't have coordinates: call bus_get_my_location first... or ask the user for a landmark and resolve it via bus_search.pois.' This tells the agent when to use alternatives, clearly separating this tool from coordinate-requiring tools.

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