MCP server exposing Swiss public transport data (SBB, ZVV, PostAuto) via transport.opendata.ch.
Swiss Transport MCP demonstrates solid tool design with clear naming (verb_noun pattern), comprehensive descriptions (100-300 chars typical), and well-structured input schemas. All 7 tools have explicit @mcp.tool() registration with type hints and parameter descriptions. Error handling includes actionable recovery guidance ('Try a different spelling', 'Check the station name with find_station'). However, output schemas are not formally documented in the code, return types are inferred from Pydantic models but not exposed in tool definitions. Parameter constraints (e.g., limit ranges 1-16, 1-40, 1-50) are documented in descriptions but not enforced via JSON Schema minima/maxima. Tool composition is clean: each tool has one responsibility, and outputs include IDs needed for chaining (station names resolve to IDs internally). Missing: tool annotations (readOnlyHint, idempotentHint) and explicit output schema documentation.
Search for Swiss public transport stations by name or partial name. Use this tool to resolve a place name to one or more canonical station records before calling ``get_connections`` or ``get_stationboard``, or to disambiguate between stations with similar names (e.g. "Bahnhof"). Parameters: query: A station name or fragment, in any Swiss national language (e.g. "Zurich HB", "Zürich HB", "Regensdorf", "Genève"). Returns a list of matching stations with their canonical name, internal ID, and WGS84 coordinates, ordered by the API's relevance score.
Find upcoming train, tram, bus, or boat connections between two stations. Use this tool when the user asks for travel options between two named places in Switzerland (e.g. "next train from Bern to Zürich" or "how do I get from Lugano to Lausanne tomorrow at 8?"). Station names are resolved by the upstream API, so common spellings work directly. Parameters: from_station: Origin station name (e.g. "Regensdorf"). to_station: Destination station name (e.g. "Zürich HB"). limit: Maximum number of connections to return (1-16). Defaults to 4. time: Optional departure time as ``HH:MM`` (24-hour, Europe/Zurich). If omitted, the API returns connections from now. date: Optional departure date as ``YYYY-MM-DD``. If omitted, today is used. Returns a list of connections including departure/arrival times (ISO 8601 with Europe/Zurich offset), total duration in minutes, transfer count, departure platform, and the individual journey sections.
Return currently active rail-traffic disruptions on the Swiss network. Use this tool when the user asks "are there any disruptions today?", "is the line to X working?", or wants context on whether to expect delays on a route. Source: SBB rail-traffic-information feed. Parameters: scope: Optional free-text fragment (station, line, or place name) used to filter the feed (e.g. "Bern", "Gotthard", "S6"). Matches ``title`` or ``description``. If omitted, all active events are returned. limit: Maximum number of events to return (1-50). Defaults to 10. Returns a list of disruptions, each with a title, description, derived severity ("info", "warning", or "critical"), validity window, and a source URL on sbb.ch where applicable.
Output schemas not formally documented. Return types are Pydantic models (Station, Connection, Departure, etc.) but not exposed in tool definitions. LLMs cannot see what fields to expect without inspecting the code.
Parameter constraints (limit ranges, time format HH:MM, date format YYYY-MM-DD) documented in descriptions but not enforced via JSON Schema minima/maxima/pattern. LLMs may pass invalid values; server must validate and return actionable errors.
last_train_home has minimal description (7 words). Does not explain when to use it, what it returns, or how it differs from get_connections. Insufficient for LLM tool selection.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | <=2025-11-25 | v2 |
Return how busy a Swiss station typically is (average daily passengers). Use this tool when the user asks "how busy is X?", "is it a major station?", or wants context for travel-time/connection planning. Parameters: station: Station name (e.g. "Zürich HB", "Bern", "Lugano"). Returns the most recent year's average daily passenger count, or ``None`` if the station is not in SBB's published frequency dataset (typically the case for non-SBB stations).
Report fixed facilities at a Swiss station: elevator, WiFi, step-free access, waiting room. Use this tool when the user asks about accessibility, amenities, or what to expect at a station (e.g. "does Bern have step-free access?", "is there WiFi at Zürich HB?"). Parameters: station: Station name (e.g. "Zürich HB", "Bern", "Regensdorf"). Returns a ``StationFacilities`` record. ``None`` on a field means the underlying SBB dataset does not cover it; ``has_lockers`` and ``has_wc`` are not exposed by ``data.sbb.ch`` and will always be ``None`` — see ``LIMITATIONS.md``.
Show the next departures from a Swiss public transport station. Use this tool when the user asks "what's leaving from <station>?" or wants the live departure board for a specific stop, without a target destination in mind. Parameters: station: Station name (e.g. "Zürich HB", "Bern", "Lugano"). limit: Maximum number of upcoming departures to return (1-40). Defaults to 10. Returns a list of upcoming departures, each with scheduled time (ISO 8601 with Europe/Zurich offset), transport category (e.g. "S", "IC", "Bus"), line number, terminus, and platform if known.
Find the latest realistic train back to ``home_station`` tonight.
No tool annotations (readOnlyHint, idempotentHint). All tools are read-only and safe to retry, but this is not declared in the schema. Agents cannot infer safety properties.
Error messages reference upstream API failures (transport.opendata.ch, data.sbb.ch) but do not provide recovery guidance for common failures (invalid station name, no connections found). Errors are actionable but could be richer.