Skip to main content
Glama
mirodn

mcp-server-public-transport

ch_nearby_stations

Find Swiss train stations near your location using coordinates. Input latitude and longitude to discover stations within a specified distance for public transport planning.

Instructions

Find nearby Swiss train stations based on coordinates (latitude, longitude).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latitudeYes
longitudeYes
distanceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function implementing the ch_nearby_stations tool. It accepts latitude, longitude, and optional distance parameters, queries the Swiss transport API (/locations endpoint) for nearby stations, and handles errors.
    async def ch_nearby_stations(
        latitude: float,
        longitude: float,
        distance: Optional[int] = 1000
    ) -> Dict[str, Any]:
        """Find nearby stations by coordinates."""
        params = {
            "x": longitude,
            "y": latitude,
            "type": "station"
        }
    
        if distance:
            params["distance"] = distance
    
        try:
            logger.info(f"Finding stations near provided coordinates")
            return await fetch_json(f"{CH_BASE_URL}/locations", params)
        except TransportAPIError as e:
            logger.error(f"CH nearby stations search failed: {e}")
            raise
  • tools/ch.py:113-116 (registration)
    Registers the ch_nearby_stations tool with the MCP server using the @mcp.tool decorator, defining its name and description. The tool is also included in the return list of register_ch_tools.
    @mcp.tool(
        name="ch_nearby_stations",
        description="Find nearby Swiss train stations based on coordinates (latitude, longitude)."
    )
  • Function signature defining the input schema (parameters with types) and output type for the tool.
    async def ch_nearby_stations(
        latitude: float,
        longitude: float,
        distance: Optional[int] = 1000
    ) -> Dict[str, Any]:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'finds' stations, implying a read-only operation, but doesn't cover aspects like rate limits, authentication needs, output format, or error handling. The description is minimal and lacks essential behavioral context for a tool with parameters.

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 with no wasted words. It is front-loaded with the core purpose, making it easy to scan and understand quickly. Every part of the sentence contributes directly to the tool's function.

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's moderate complexity (3 parameters, no annotations, but with an output schema), the description is incomplete. It covers the basic purpose but lacks usage guidelines, parameter details, and behavioral context. The output schema may handle return values, but the description doesn't provide enough context for effective tool selection and invocation.

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 for undocumented parameters. It mentions 'coordinates (latitude, longitude)' but doesn't explain the 'distance' parameter or its default value. The description adds minimal semantic value beyond the schema, failing to clarify parameter roles or usage.

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 verb 'find' and the resource 'nearby Swiss train stations', specifying the geographic scope (Swiss) and the input basis (coordinates). It distinguishes from siblings like 'be_search_stations' or 'no_nearest_stops' by emphasizing proximity and Swiss context, though it doesn't explicitly compare them.

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 such as 'ch_search_stations' or 'no_nearest_stops'. It mentions coordinates as input but doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer usage from the name and parameters alone.

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