Skip to main content
Glama

be_search_stations

Search for Belgian train stations by name using a query string. This tool helps locate public transport stations within Belgium efficiently.

Instructions

Search for Belgian train stations by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The main handler function for the 'be_search_stations' tool. It validates the query, constructs API parameters, fetches station data from the iRail API, and handles errors.
    async def be_search_stations(query: str) -> Dict[str, Any]: if not query or not query.strip(): raise ValueError("Station search query cannot be empty") params = {"input": query.strip(), "format": "json"} try: logger.info(f"Searching stations for: {query.strip()}") return await fetch_json(f"{BE_BASE_URL}/stations/", params) except TransportAPIError as e: logger.error(f"Belgium station search failed: {e}", exc_info=True) raise
  • tools/be.py:52-55 (registration)
    MCP tool registration decorator for 'be_search_stations', specifying the tool name and description.
    @mcp.tool( name="be_search_stations", description="Search for Belgian train stations by name." )
  • tools/be.py:107-112 (registration)
    The 'register_be_tools' function returns a list of tool functions including 'be_search_stations' for registration with the MCP server.
    return [ be_search_connections, be_search_stations, be_get_departures, be_get_vehicle ]

Other Tools

Related 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