Skip to main content
Glama
mirodn

mcp-server-public-transport

ch_get_departures

Retrieve real-time departure schedules for Swiss train stations to plan journeys and check upcoming train times.

Instructions

Get departure board for a Swiss train station with real-time information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYes
limitNo
datetimeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function implementing the ch_get_departures tool. Cleans station name, builds parameters for the Swiss transport API (/stationboard endpoint), fetches JSON data, and handles errors.
    async def ch_get_departures(
        station: str,
        limit: Optional[int] = 10,
        datetime: Optional[str] = None
    ) -> Dict[str, Any]:
        """Get departures from a Swiss train station."""
        station_clean = validate_station_name(station)
    
        params = {
            "station": station_clean,
            "limit": limit or 10
        }
    
        if datetime:
            params["datetime"] = datetime
    
        try:
            logger.info(f"Getting departures for: {station}")
            return await fetch_json(f"{CH_BASE_URL}/stationboard", params)
        except TransportAPIError as e:
            logger.error(f"CH departures fetch failed: {e}")
            raise
  • tools/ch.py:86-89 (registration)
    The @mcp.tool decorator that registers the ch_get_departures function as an MCP tool with its name and description.
    @mcp.tool(
        name="ch_get_departures",
        description="Get departure board for a Swiss train station with real-time information."
    )
  • tools/ch.py:139-144 (registration)
    The register_ch_tools function returns a list of registered tool functions, including ch_get_departures.
    return [
        ch_search_connections,
        ch_search_stations,
        ch_get_departures,
        ch_nearby_stations
    ]
  • server.py:50-50 (registration)
    In the main server initialization, register_ch_tools(mcp) is called to register all CH tools, including ch_get_departures, with the MCP server instance.
    ch_tools = register_ch_tools(mcp)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'real-time information' which hints at freshness, but doesn't disclose critical behavioral traits like rate limits, authentication needs, error conditions, pagination, or what happens when station names are ambiguous. For a read operation with real-time data, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place: 'Get' (action), 'departure board' (resource), 'Swiss train station' (scope), 'real-time information' (key feature). No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), the description's main gaps are in parameter semantics and behavioral transparency. For a read-only tool with real-time data, the description is minimally viable but lacks details on parameter usage and operational constraints, making it incomplete for confident agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what format 'station' expects (e.g., station code, name), what 'limit' controls, or how 'datetime' should be formatted. With 3 parameters (1 required) and zero schema descriptions, this is inadequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get departure board') and resource ('Swiss train station'), and specifies the data includes 'real-time information'. It distinguishes from siblings by specifying 'Swiss' (vs. 'be', 'no', 'uk' prefixes), but doesn't explicitly differentiate from similar departure tools like 'be_get_departures' or 'no_stop_departures' beyond the geographic scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools for departures (be_get_departures, no_stop_departures, uk_live_departures), there's no indication of when this Swiss-specific tool is preferred over others, nor any prerequisites or constraints mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mirodn/mcp-server-public-transport'

If you have feedback or need assistance with the MCP directory API, please join our Discord server