Install
openclaw skills install mta-commuterNYC commuter transit: LIRR, Metro-North, and Subway schedules, trip planning, and service alerts. Use when the user asks about train departures, arrivals, commute times, trip options, or service disruptions. Also for multi-leg trip planning between locations, finding nearby stations across all systems, alternatives to a specific train, or track alerts. Triggers on "LIRR", "Metro-North", "MNR", "subway", "train schedule", "train times", "train home", "get me to", "how do I get to", "trip from", "alternatives", "track alert", "nearby stations", "commute", "train options", "service alerts", "MTA".
openclaw skills install mta-commuterLook up LIRR, Metro-North, and NYC Subway schedules with live delay data using scripts/mta.py. Uses MTA GTFS static feeds and GTFS-RT real-time APIs (no API key required). Requires the gtfs-realtime-bindings pip package (auto-installed via ClawHub; otherwise pip install -r requirements.txt).
Run from the skill directory (skills/mta/):
python3 scripts/mta.py lirr "<origin>" "<destination>" --date YYYY-MM-DD --time HH:MM
python3 scripts/mta.py mnr "<origin>" "<destination>" --date YYYY-MM-DD --time HH:MM
--date and --time default to now if omitted.--json for machine-readable output, --count N to change result count (default 5).--no-live to show schedule only.Plan trips across LIRR, Metro-North, and Subway connections. Uses data/locations.json for saved locations.
# Using saved locations
python3 scripts/mta.py trip --near-origin work --near-dest home --time 17:00
# Using coordinates
python3 scripts/mta.py trip --near-origin 40.75,-73.99 --near-dest 40.74,-73.68 --time 17:00
# Custom radius and count
python3 scripts/mta.py trip --near-origin work --near-dest home --time 17:00 --radius 2 --count 8
Trip planning finds commuter rail options from all systems and includes subway transfer legs where applicable (Penn Station, Grand Central, Atlantic Terminal, Jamaica, Woodside, Harlem-125 St).
python3 scripts/mta.py stations nearby --near home --radius 2
python3 scripts/mta.py stations nearby --lat 40.74 --lon -73.68
Returns LIRR, Metro-North, and Subway stations sorted by distance.
python3 scripts/mta.py alerts # All systems
python3 scripts/mta.py alerts --system lirr # LIRR only
python3 scripts/mta.py alerts --system mnr # Metro-North only
python3 scripts/mta.py alerts --system subway # Subway only
python3 scripts/mta.py alerts --json # JSON output
python3 scripts/mta.py lirr --stations # List all LIRR stations
python3 scripts/mta.py mnr --stations # List all MNR stations
python3 scripts/mta.py lirr --routes # List LIRR branches
python3 scripts/mta.py mnr --routes # List MNR lines
python3 scripts/mta.py lirr --find-station "hyde" # Search for a station
python3 scripts/mta.py lirr --alerts # System-specific alerts
Locations are stored in data/locations.json. Manage them conversationally:
Format:
{
"home": {
"address": "123 Main St, Anytown, NY 11000",
"lat": 40.7432,
"lon": -73.6812,
"label": "Home"
}
}
When this skill is first activated and data/locations.json doesn't exist, ask the user:
After setup, when the user mentions a saved location, consider whether they might be asking about transit -- even without explicitly saying "train." For example, "how do I get home from the city" is a transit request if home is a saved location.
Watch for track announcements on LIRR or Metro-North trains using scripts/check_track.py via openclaw cron.
# LIRR track watch
openclaw cron add --every 20s \
--command "cd skills/mta && python3 scripts/check_track.py --train 1582 --station NYK" \
--channel telegram --delete-after-run \
--name "Track watch: 5:22 PM to Huntington"
# Metro-North track watch
openclaw cron add --every 20s \
--command "cd skills/mta && python3 scripts/check_track.py --system mnr --train 873 --station GCT" \
--channel telegram --delete-after-run \
--name "Track watch: 5:43 PM to White Plains"
Note: check_track.py queries undocumented endpoints used by the mylirr.org and mymnr.org web apps (backend-unified.mylirr.org / backend-unified.mymnr.org). These are not official public APIs and may change or become unavailable without notice. The rest of the skill uses the official MTA GTFS feeds and is not affected.
openclaw cron add using the train number and --system flag--delete-after-run)