Skip to main content
Glama

Get full line detail (stops + live buses)

bus_get_line_detail
Read-onlyIdempotent

Get complete details for a bus line including stations, real-time bus positions, first/last times, and reverse direction info.

Instructions

Full info for a line: rider-facing fields (name, first/last/price, stationsNum), the full ordered station list, the reverse-direction lineId, and every bus currently on the line.

Use this — not bus_get_timetable — to answer "is line X still running" or "first/last bus time" questions. The timetable tool only has data for a small minority of lines.

Subway lines are NOT supported. If bus_search returned a line with isSubway=true (e.g. lineId=1057 for 地铁2号线), this endpoint returns an empty payload — the response will carry empty: true and a hint field pointing at bus_get_nearby_stops / bus_plan_transit. Don't retry; route to those tools instead.

Args:

  • city_id (string, required)

  • line_id (string, required): from bus_search.lines[*].lineId

  • lat / lng (string, optional): caller's WGS-84 coordinates

  • response_format ('markdown' | 'json')

Returns (json): { "line": { "lineId":"...", "name":"71", "lineNo":"r95817", "direction":0, "startSn":"...", "endSn":"...", "firstTime":"05:30", "lastTime":"23:30", "price":"2元", "stationsNum":24 }, "stations": [{ "order":1, "sId":"...", "sn":"...", "wgsLat":..., "wgsLng":..., "physicalStId":"...", "namesakeStId":"...", "metros":[{"name":"地铁14号线","lineNo":"14号线","color":"97,96,32"}] }, ...], "buses": [{ "busId":"...", "order":2, "lat":..., "lng":..., "speed":5.7, "capacity":0, "distanceToWaitStn":...}], "reverseDirection": { "lineId":"...", "startSn":"...", "endSn":"...", "firstTime":"04:30", "lastTime":"22:30", "price":"2元" } | null, "depDesc": "...", "preArrivalTime": "...", "targetOrder": 24, "empty": true, "hint": "..." // present only when upstream returned no data (subway / retired line) }

Each station carries:

  • 'order' → feed into bus_get_line_realtime / bus_list_line_buses as target_order

  • 'sId' → feed into bus_get_line_realtime as station_id (NOT into bus_get_stop_detail!)

  • 'physicalStId' + 'namesakeStId' → feed into bus_get_stop_detail to see every line through that stop

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
city_idYes
line_idYeslineId from bus_search.lines / bus_get_nearby_stops.lines
latNo
lngNo
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 declare readOnlyHint=true, etc. Description adds that subway lines return empty payload with hint field, and explains response structure including 'empty: true' case. No contradiction.

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

Conciseness5/5

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

Well-structured with front-loaded purpose and usage, clear parameter list, and organized return value explanation. Every sentence adds value without redundancy.

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?

No output schema, yet description provides a complete JSON example and explains all keys, special cases (empty response), and relationships with other tools. Comprehensive for a tool with 5 parameters.

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

Parameters5/5

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

Schema description coverage is only 40%, but description adds meaning for all parameters: explains city_id requirement, line_id source, lat/lng usage, response_format options, and maps station fields to other tools. Fully compensates for low schema coverage.

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?

Description clearly states it provides 'Full info for a line: rider-facing fields, full ordered station list, reverse-direction lineId, and every bus currently on the line.' It also differentiates from sibling tool bus_get_timetable with a specific use case.

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?

Explicitly says 'Use this — not bus_get_timetable — to answer "is line X still running" or "first/last bus time" questions.' Also notes subway lines are not supported with clear alternative tools and instruction not to retry.

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