Check live Transport for London travel status. Use this when the user asks about London transport, tube status, train delays, disruptions, next trains, or journey planning.
Commands
Run the script at {baseDir}/tfl.py using uv run.
All lines status:
uv run {baseDir}/tfl.py status
Specific lines:
uv run {baseDir}/tfl.py status --line victoria,central,northern
Only disruptions (skip lines running normally):
uv run {baseDir}/tfl.py disruptions
Detail on a specific line:
uv run {baseDir}/tfl.py line northern
Next trains at a station:
uv run {baseDir}/tfl.py arrivals "oxford circus"
uv run {baseDir}/tfl.py arrivals "bank" --limit 3
uv run {baseDir}/tfl.py arrivals "oxford circus" --line victoria
Plan a journey:
uv run {baseDir}/tfl.py journey "oxford circus" "kings cross"
uv run {baseDir}/tfl.py journey "waterloo" "canary wharf" --limit 2
Find a station by name:
uv run {baseDir}/tfl.py search "paddington"
Live busyness at a station:
uv run {baseDir}/tfl.py busyness "bank"
Typical busyness pattern for a day:
uv run {baseDir}/tfl.py busyness-pattern "bank" monday
JSON output (--json works anywhere):
uv run {baseDir}/tfl.py --json status
uv run {baseDir}/tfl.py arrivals "bank" --json
Line names
Natural names work: "hammersmith and city", "elizabeth line", "waterloo & city", "overground" are all accepted. Canonical lowercase: bakerloo, central, circle, district, hammersmith-city, jubilee, metropolitan, northern, piccadilly, victoria, waterloo-city, dlr, elizabeth, liberty, lioness, mildmay, suffragette, weaver, windrush, tram
Requires TFL_APP_KEY. Get a free key at https://api-portal.tfl.gov.uk/products (500 req/min). Set to NA if you don't have one (works without, ~30 req/min).
When to use which command
- •User asks "how's the tube?" →
disruptions(only shows problems, fast to scan) - •User asks about a specific line →
line <name> - •User wants the full picture →
status - •User names multiple lines →
status --line line1,line2 - •User asks "when's the next train?" →
arrivals "<station>" - •User asks about arrivals on a specific line →
arrivals "<station>" --line <line> - •User asks "how do I get from X to Y?" →
journey "<from>" "<to>" - •User asks about a station name or ID →
search "<query>" - •User asks "how busy is X?" →
busyness "<station>"(live, right now) - •User asks "when is X busiest?" →
busyness-pattern "<station>" <day>