Xpersona
K

KMB and LWB Bus Arrivals

CLAWHUB · Unverified

Retrieve real-time KMB bus arrival information. getArrival returns plain text.

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bfk0ef12w09pdqpw6wghae183eqa8:kmb-bus-arrival
  1. Install using `clawhub skill install s17bfk0ef12w09pdqpw6wghae183eqa8:kmb-bus-arrival` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/stevenho1394/kmb-bus-arrival before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-stevenho1394-kmb-bus-arrival/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

69,386 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: kmb-bus-arrival
description: Retrieve real-time KMB bus arrival information. getArrival returns plain text.
version: 1.2.2
author: Steven Ho
repository: https://github.com/StevenHo1394/kmb-bus-arrival
tools:
  - name: getArrival
    description: Get the next bus arrival times for a specific route and stop name. Returns plain text.
    command: python3 kmb_bus.py getArrival {route} {stop_name}
    inputSchema:
      type: object
      required: [route, stop_name]
      properties:
        route:
          type: string
          pattern: '^[A-Za-z0-9]{1,16}$'
          maxLength: 16
        stop_name:
          type: string
          pattern: '^[\w\s\u4e00-\u9fff\(\)()\-]{1,50}$'
          maxLength: 50
    output:
      format: text
---

# KMB Bus Arrival

Retrieve real-time KMB bus arrival information using the official KMB Open Data API (`data.etabus.gov.hk`).

## Installation

```bash
# Place kmb_bus.py and SKILL.md in your skills directory
# Requires: Python 3.8+, internet access to data.etabus.gov.hk
# Dependencies: certifi (pip install certifi)
```

## Usage

### Hermes CLI / OpenClaw

```bash
# Get arrivals for route E31 at Panda Hotel
python3 kmb_bus.py getArrival E31 "Panda Hotel"

# Get arrivals for route 265M at Chung On Street
python3 kmb_bus.py getArrival 265M "Chung On Street"
```

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `route` | string | KMB route number (e.g., `E31`, `265M`, `269M`) |
| `stop_name` | string | Stop name in English or Chinese (partial match supported) |

## Output Format

```
*E31 (to TSUEN WAN (DISCOVERY PARK))*

Stop: *PANDA HOTEL (TW281)*

Next arrivals:
- 20:46 HKT
- 21:11 HKT

(Current Time: 20:30 HKT)
```

### Features

- **Auto-direction**: Tries both inbound and outbound; reports whichever has the stop. If both directions serve the stop, both are shown.
- **Alternate stop ID fallback**: If the given stop name matches multiple stops on the route, uses up to 2 matches.
- **Fresh API calls**: No caching — all requests hit the live KMB API.
- **Plain text output**: Human-readable with Traditional Chinese stop names.
- **Human-readable errors**: Clear error messages for invalid routes/stops.

## Implementation Details

- **Script**: `kmb_bus.py` — single command `getArrival <route> <stop_name>`
- **API**: `https://data.etabus.gov.hk/v1/transport/kmb/`
  - `/route-stop/{route}/{bound}/1` — stop sequence with UUID IDs
  - `/stop/{stop_id}` — stop name lookup
  - `/eta/{stop_uuid}/{route}/1` — real-time ETA (Format B, UUID-based)
- **Timezone**: All times in HKT (UTC+8)
- **Retries**: 2 retries with exponential backoff, 3s total timeout per call

## Version History

### v1.2.2 (2026-09-13)
- Security fixes per ClawHub audit
- API call budget raised to 100, timeouts increased to 3s
- Fixed datetime.utcnow() deprecation
- Added README.md, flattened directory structure

### v1.2.1 (2026-08-22)
- Full removal of caching — all API calls are fresh
- Plain-text erro

README.md

# KMB Bus Arrival

Retrieve real-time KMB bus arrival information using the official KMB Open Data API (`data.etabus.gov.hk`).

## Installation

```bash
# Place kmb_bus.py and SKILL.md in your skills directory
# Requires: Python 3.8+, internet access to data.etabus.gov.hk
# Dependencies: certifi (pip install certifi)
```

## Usage

```bash
# Get arrivals for route E31 at Panda Hotel
python3 kmb_bus.py getArrival E31 "Panda Hotel"

# Get arrivals for route 265M at Chung On Street
python3 kmb_bus.py getArrival 265M "Chung On Street"

# Get arrivals for route 265M at 荃灣眾安街 (Chinese)
python3 kmb_bus.py getArrival 265M "荃灣眾安街"
```

### Parameters

| Parameter   | Type   | Description                                                                 |
| ----------- | ------ | --------------------------------------------------------------------------- |
| `route`     | string | KMB route number (e.g., `E31`, `265M`, `269M`) — alphanumeric, max 16 chars |
| `stop_name` | string | Stop name in English or Chinese (partial match supported) — max 50 chars    |

## Output Format

```
*E31 (to TSUEN WAN (DISCOVERY PARK))*

Stop: *PANDA HOTEL (TW281)*

Next arrivals:
- 20:46 HKT
- 21:11 HKT

(Current Time: 20:30 HKT)
```

If a stop serves both directions, both are shown:

```
*265M (to LAI YIU BUS TERMINUS (KW991) / TIN HENG ESTATE BUS TERMINUS (TN972))*

Stop: *CHUNG ON STREET TSUEN WAN (TW388)*

Next arrivals (to LAI YIU BUS TERMINUS (KW991)):
- 21:27 HKT
- 21:45 HKT
- 22:04 HKT
Next arrivals (to TIN HENG ESTATE BUS TERMINUS (TN972)):
- 21:29 HKT
- 21:43 HKT
- 21:55 HKT

(Current Time: 21:24 HKT)
```

## Features

- **Auto-direction**: Tries both inbound and outbound; reports whichever has the stop. If both directions serve the stop, both are shown.
- **Alternate stop ID fallback**: If the given stop name matches multiple stops on the route, uses up to 2 matches.
- **Fresh API calls**: No caching — all requests hit the live KMB API.
- **Plain text output**: Human-readable with Traditional Chinese stop names.
- **Human-readable errors**: Clear error messages for invalid routes/stops.
- **Strict input validation**: Route and stop name validated against allowlist patterns and length limits.
- **No shell interpolation**: Arguments passed as argv array, not shell command string.
- **Rate limiting**: Max 10 requests/minute per process.
- **API call budget**: Max 100 API calls per invocation.

## Security

This skill has been hardened per ClawHub security audit (v1.2.2):

- Removed obsolete tool declarations that didn't match implementation
- Strict input schemas with patterns and maxLength for all parameters
- Arguments passed via argv array (no shell interpolation)
- Local rate limiting (10 req/min) and API call budget (100 calls/invocation)
- Explicit SSL certificate verification with certifi CA bundle
- Unified error messages without internal API structure disclosure
- Removed redundant `/route-stop` full fetch (optimization)

## API

- **Base**: `https://data.eta

_meta.json

{
  "ownerId": "kn7440a45t98tzq87bk5f06ge582vpkm",
  "slug": "kmb-bus-arrival",
  "version": "1.2.2",
  "publishedAt": 1789309859902
}

skill-card.md

## Description:

Retrieve real-time KMB bus arrival information. getArrival returns plain text.

This skill is ready for commercial/non-commercial use.

## Publisher:

[stevenho1394](https://clawhub.ai/user/stevenho1394)

### License/Terms of Use:

MIT-0

## Use Case:

External users and agents use this skill to fetch current KMB and LWB bus arrival times by route and stop name for Hong Kong transit planning.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill makes live HTTPS requests to the public KMB API.

Mitigation: Use it only in environments where outbound access to data.etabus.gov.hk is expected, and handle temporary network or service errors.

Risk: The skill depends on the certifi Python package for certificate verification.

Mitigation: Pin certifi to a reviewed version for stronger reproducibility.

## Reference(s):

- [KMB Open Data API](https://data.etabus.gov.hk/v1/transport/kmb/)
- [ClawHub skill listing](https://clawhub.ai/stevenho1394/skills/kmb-bus-arrival)

## Skill Output:

**Output Type(s):** [text]

**Output Format:** [Plain text]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Returns human-readable arrivals in HKT, with up to three arrival times per matched stop.]

## Skill Version(s):

1.2.2 (source: frontmatter and server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to KMB and LWB Bus Arrivals and adjacent AI workflows.