Get a line's per-trip schedule (rarely useful)
bus_get_timetableObtain 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
timetablearray 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
| Name | Required | Description | Default |
|---|---|---|---|
| city_id | Yes | ||
| line_id | Yes | ||
| line_no | Yes | Rider-facing short name (search.lines[].name), e.g. '71'. NOT the internal lineNo like 'r95817'. | |
| direction | Yes | ||
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |