Plan TfL journeys from start/end/time, resolve locations (prefer postcodes), and warn about disruptions; suggest alternatives when disrupted.
Use this skill when the user wants a TfL journey plan and needs disruption awareness.
Reference: https://tfl.gov.uk/info-for/open-data-users/api-documentation
Use scripts/tfl_journey_disruptions.py for a quick journey + disruption check.
Examples:
python3 scripts/tfl_journey_disruptions.py \"940GZZLUSTD\" \"W1F 9LD\" --depart-at 0900
python3 scripts/tfl_journey_disruptions.py --from \"Stratford\" --to \"W1F 9LD\" --arrive-by 1800
Notes:
parameterValue.TFL_APP_IDTFL_APP_KEYIf any of these are missing or ambiguous, ask the user for clarification.
Prefer postcodes when available. Otherwise, resolve place names and stations:
{from} or {to}.StopPoint/Search/{query} and choose a hub or the relevant NaPTAN ID.Call:
/Journey/JourneyResults/{from}/to/{to}?date=YYYYMMDD&time=HHMM&timeIs=Depart|Arrive
Guidelines:
timeIs=Arrive; otherwise default to Depart.From the response, take the first 1-3 journeys. For each, capture:
Line IDs usually appear in leg.routeOptions[].lineIdentifier.id or leg.line.id. Ignore walking legs.
For each journey, collect unique line IDs and call:
/Line/{ids}/Status
Treat a route as disrupted if any line status is not "Good Service" or includes a reason. Summarize the severity and reason.
Optionally, check station-specific issues with /StopPoint/{id}/Disruption when relevant.