Skip to main content
Glama

Get a line's per-trip schedule (rarely useful)

bus_get_timetable
Read-onlyIdempotent

Obtain the departure timetable for a specific bus line direction. The response shows scheduled trip times or notes that the line runs at fixed intervals.

Instructions

Per-trip departure schedule for a line. The upstream returns one of three modes via mode:

  • 'scheduled' (timeTableType=1): an explicit timetable array of trips

  • 'interval' (timeTableType=2): the line runs at a fixed headway — NO per-trip times are returned

  • 'special' / 'unknown' (timeTableType=3 or other)

Most lines in Shanghai are 'interval', so this tool is rarely the right one. To answer "first/last bus", "is the line still running", or "what's the next departure", call bus_get_line_detail instead — it always returns firstTime / lastTime / price / live buses.

Args:

  • city_id (string, required)

  • line_id (string, required)

  • line_no (string, required): rider-facing short name from bus_search.lines[].name (e.g. '71'). Do NOT pass the internal lineNo like 'r95817'.

  • direction ('0'|'1'): the line direction

  • response_format ('markdown' | 'json')

Returns (json): { "line": { "lineId":"...", "name":"71", "direction":0, "startSn":"...", "endSn":"..." }, "timeTableType": 2, "mode": "interval", "timetable": null, "note": "This line runs at a fixed interval — ..." }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
city_idYes
line_idYes
line_noYesRider-facing short name (search.lines[].name), e.g. '71'. NOT the internal lineNo like 'r95817'.
directionYes
response_formatNoOutput format: 'markdown' for human-readable text, 'json' for full structured datamarkdown
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly and idempotent. Description adds three behavioral modes (scheduled, interval, special) and sample output, providing good context beyond annotations. Could mention rate limits or error responses, but overall strong.

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?

Description is concise, well-structured with clear sections, and uses formatting (bold, code) to highlight key points. No unnecessary words; every sentence adds value.

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?

For a simple read-only tool with good annotations, the description provides complete context: purpose, behavior modes, parameter guidance, and a sample return. Missing output schema is compensated by inline description of return fields.

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 covers 40% of parameters with descriptions (line_no and response_format). Tool description reinforces those and adds critical warning about line_no (not internal line). For other params (city_id, line_id, direction), no extra detail, but the warning for line_no is valuable.

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?

Title and description clearly state this tool returns per-trip schedule, and explicitly warn that most lines in Shanghai operate on fixed intervals, making this tool rarely useful. It distinguishes itself from siblings like bus_get_line_detail.

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?

Description explicitly tells when not to use it (most lines are 'interval') and directs users to bus_get_line_detail for common queries like first/last bus times. This is excellent guidance.

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