← Back to Skills Marketplace
tomfong

Hong Kong MTR Next-Train ETA | 港鐵實時到站預報

by Tom FONG · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
190
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install hk-mtr-next-train
Description
Fast, reliable, and token-efficient Hong Kong MTR next-train ETA lookup with fuzzy station matching and bilingual output (zh-HK/en). Use for queries like nex...
README (SKILL.md)

Hong Kong MTR Next Train (v1.0.1)

Post-Install Recommendation

Recommend to run once after install to sync station dictionary:

cd {skill_dir}/scripts
python3 sync_mtr_stations.py

Data Refresh Rule

  • If user explicitly asks to update line/station data (新站、改名、線路更新), run:
cd {skill_dir}/scripts
python3 sync_mtr_stations.py
  • If user did not ask for refresh, prefer local CSV for faster matching.

Allowed Commands

  • python3 scripts/mtr_eta.py {STATION_NAME} {LINE_NAME(optional)} {LANG(optional)} {TO_STATION(optional)}
  • python3 scripts/sync_mtr_stations.py

Safety Scope

  • Allowed domains:
    • https://rt.data.gov.hk/*
    • https://opendata.mtr.com.hk/*
  • Write scope (skill-local only):
    • scripts/mtr_lines_and_stations.csv
    • scripts/__pycache__/
  • Do not access sensitive files outside skill directory.
  • Never request/store/output secrets.

Language Handling

  • Chinese query → TC
  • English/non-Chinese query → EN

Features

  • Real-time ETA: Live MTR train arrival times from DATA.GOV.HK
  • Fuzzy Matching: Smart station name matching (e.g., "旺角" matches "Mong Kok")
  • Bilingual Output: Traditional Chinese and English support
  • Token Efficient: Local CSV cache minimizes API calls and token usage
  • Multi-line: Supports all 10 MTR lines including Airport Express

Usage

  • Station + line: query that combo directly.
  • Station only: query all lines serving that station.
  • Line only: ask user which station (suggest 1–2 stations on that line).
  • Neither line nor station: ask user which station.
  • Line-station conflict: state mismatch, then show all lines at that station.

Output Policy

  • Never fabricate ETA values.
  • Keep output concise, data-first.
  • Global rule: for each direction, use API-available departures (up to 4) as source set, then split by destination if needed.
  • Do not down-sample to only 1 train when more data exists.

ETA wording

  • Within 1 minute: 即將到達 / Arriving
  • At 0 minute: 即將離開 / Departing
  • Departed within 0–2 minutes: 已離開 / Departed
  • Departed > 2 minutes: do not show

Station output format (default)

  • Title once:
    • tc: 🚈 {站名}的列車班次如下:
    • en: 🚈 Next trains at {Station}:
  • Then one section per line: {LineName} {LineEmoji}
  • One blank line between platform blocks
  • Section divider between line sections: --------------
  • If output contains multiple stations in one reply, add one extra station divider between station blocks: ====================
  • Block format:
    • tc:
      • • {月台}號月台|往{總站}
      • {ETA1}、{ETA2}、{ETA3}、{ETA4}
    • en:
      • • Platform {N} | to {Destination}
      • {ETA1}, {ETA2}, {ETA3}, {ETA4}
  • If platform changes within same destination block, include platform inline per ETA.

Line emoji mapping

  • AEL 機場快線: ✈️
  • TCL 東涌線: 🟠
  • TML 屯馬線: 🤎
  • TKL 將軍澳線: 🟣
  • EAL 東鐵線: 🩵
  • SIL 南港島線: 🔰
  • TWL 荃灣線: 🔴
  • ISL 港島線: 🔵
  • KTL 觀塘線: 🟢
  • Fallback: 🚇

Source footer

  • Add one blank line, then:
    • tc: 資料來源:開放數據平台
    • en: Source: DATA GOV HK

Fallback

If no result after matching/retry:

  • tc: {站名} @ {線路}:尾班車已過或未有班次資料
  • en: {Station} @ {Line}: Service hours have passed / No information found

Changelog

2026-03-22 · v1.0.1

  • Update docs

2026-03-18 · v1.0.0

  • First stable release
Usage Guidance
This skill appears coherent and limited to fetching MTR schedule data. Before installing or running, you may want to: (1) inspect the two included Python scripts (mtr_eta.py and sync_mtr_stations.py) yourself (they are small and readable), (2) run the sync script manually the first time so you know when network activity occurs, (3) confirm you are comfortable with the two allowed domains (opendata.mtr.com.hk and rt.data.gov.hk), and (4) run it in a restricted environment if you prefer (it only writes a CSV and __pycache__ under the skill). Note: the registry lists no homepage/source verification in metadata, though the README references a GitHub URL — if provenance matters, verify the upstream repository before use.
Capability Analysis
Type: OpenClaw Skill Name: hk-mtr-next-train Version: 1.0.1 The skill is a legitimate tool for retrieving real-time Hong Kong MTR arrival data using official sources (rt.data.gov.hk and opendata.mtr.com.hk). The Python scripts (mtr_eta.py and sync_mtr_stations.py) perform standard data processing and HTTP requests without any signs of malicious intent, data exfiltration, or unauthorized system access. The SKILL.md instructions are well-defined and align strictly with the stated purpose of the tool.
Capability Assessment
Purpose & Capability
Name/description match the actual behavior: a Python script that looks up MTR ETAs using DATA.GOV.HK and an MTR open-data CSV. Required binary (python3) is appropriate and no unrelated credentials or tools are requested.
Instruction Scope
SKILL.md directs only to run the included Python scripts. The scripts fetch the official CSV and call the rt.data.gov.hk API, use a local CSV cache, and write only the local CSV and __pycache__ as documented. There are no instructions to read system files, env secrets, or send data to unexpected endpoints.
Install Mechanism
No install spec; the skill is instruction/code-only. The only network downloads performed by the scripts are to documented, legitimate endpoints (opendata.mtr.com.hk and rt.data.gov.hk). No third-party binary downloads or obscure URLs are used.
Credentials
The skill requests no environment variables or credentials. All network calls are to the public MTR/data.gov.hk endpoints required for ETA lookups; write scope is limited to skill-local files.
Persistence & Privilege
Skill is not force-included (always:false). It does not request system-wide configuration changes or persistent elevated privileges; its write scope is documented and limited to the skill directory.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hk-mtr-next-train
  3. After installation, invoke the skill by name or use /hk-mtr-next-train
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Documentation updated in SKILL.md and README.md for clarity and accuracy. - No code logic or functional changes.
v1.0.0
hk-mtr-next-train v1.0.0 - First stable release with real-time Hong Kong MTR train ETA lookup. - Supports fuzzy station matching and bilingual (Traditional Chinese/English) output. - Handles single or multi-station queries across all 10 MTR lines. - Local station cache minimizes API calls for faster response. - Clear output formatting, platform/direction details, customizable via command-line. - Safe, read-only integration with open data sources.
Metadata
Slug hk-mtr-next-train
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Hong Kong MTR Next-Train ETA | 港鐵實時到站預報?

Fast, reliable, and token-efficient Hong Kong MTR next-train ETA lookup with fuzzy station matching and bilingual output (zh-HK/en). Use for queries like nex... It is an AI Agent Skill for Claude Code / OpenClaw, with 190 downloads so far.

How do I install Hong Kong MTR Next-Train ETA | 港鐵實時到站預報?

Run "/install hk-mtr-next-train" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Hong Kong MTR Next-Train ETA | 港鐵實時到站預報 free?

Yes, Hong Kong MTR Next-Train ETA | 港鐵實時到站預報 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Hong Kong MTR Next-Train ETA | 港鐵實時到站預報 support?

Hong Kong MTR Next-Train ETA | 港鐵實時到站預報 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Hong Kong MTR Next-Train ETA | 港鐵實時到站預報?

It is built and maintained by Tom FONG (@tomfong); the current version is v1.0.1.

💬 Comments