MCP server for Hong Kong bus transportation data, providing real-time arrival times, route planning, and location search using pgRouting and PostGIS
HK Transportation MCP demonstrates solid tool design with clear, domain-specific naming and comprehensive parameter schemas. All 6 tools have descriptions (avg 180 chars) and properly typed input schemas with required/optional fields. Naming follows verb_noun convention (nearby_arrivals, route_arrivals, search_location). However, output schemas are not documented in the visible code, tool results are returned as CallToolResult but the structure of returned data (fields, types) is not declared. Error handling is present but generic (mcp.NewToolResultError). No tool annotations (readOnlyHint, destructiveHint) despite all tools being READ_ONLY. Parameter descriptions are good (avg 65 chars) but lack format constraints (e.g., latitude/longitude ranges, radius bounds). Missing dependency hints (e.g., 'Call search_location first if you only have a place name'). Tool composition is sound, each tool has one responsibility and output IDs (stop_id, route_number) chain to downstream tools.
Find bus stops near a location and get real-time arrival times. Returns upcoming bus arrivals sorted by ETA for all routes serving nearby stops.
Find bus routes connecting an origin to a destination and get real-time arrival times. Returns direct routes and transfer routes supporting multiple transfers via pgRouting shortest-path search.
Find nearby bus stops serving a specific route and get real-time arrival times for that route. Use this when the user asks about a specific bus route near their location (e.g., 'when is the next 170 bus?'). If the user specifies a destination/direction (e.g., '77 to Causeway Bay'), pass the destination name — the tool will geocode it and filter to the correct direction automatically.
Search for a location in Hong Kong by name and find nearby bus stops. Uses geocoding to resolve the location, then finds bus stops within walking distance.
Search for bus routes by route number and operator. Returns all matching routes with their stops and sequences.
Output schemas not documented. Tool results are returned as CallToolResult but the structure of returned data (fields, types, pagination) is not declared in code or comments. LLMs cannot plan downstream calls without knowing what fields to expect.
No tool annotations despite all tools being READ_ONLY. Tools should declare readOnlyHint=true to signal to agents that these calls are safe to retry and have no side effects.
Numeric parameters lack bounds. latitude/longitude accept any number; radius accepts any positive number. Should declare min/max (e.g., latitude -90 to 90, radius 50-2000m) to prevent invalid API calls.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | B | 79 | <=2025-11-25 | v2 |
Get real-time estimated time of arrival (ETA) for a specific bus stop and route. Returns upcoming arrivals with ETA times and remarks.
Error handling is generic. mcp.NewToolResultError returns raw error strings without recovery guidance. Should categorize errors (retryable vs user-fixable) and suggest next steps (e.g., 'Location not found. Try search_location() with a different query.').
Missing dependency hints in descriptions. route_nearby_arrivals accepts a destination parameter but does not explain that search_location should be called first if the user only provides a place name. Multi-step workflows are not documented.