Skip to main content
Glama

be_get_departures

Retrieve real-time departure schedules for Belgian train stations using a locally hosted server for European public transport data.

Instructions

Get live departure board for a Belgian train station.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
stationYes

Implementation Reference

  • The main handler function that executes the tool logic: validates input, constructs API parameters, fetches live departure data from iRail API, and handles errors.
    async def be_get_departures(station: str, limit: Optional[int] = 10) -> Dict[str, Any]: if not station or not station.strip(): raise ValueError("Station name must be provided for departures lookup") params = { "station": station.strip(), "limit": limit or 10, "format": "json" } try: logger.info(f"Fetching departures for station: {station.strip()}") return await fetch_json(f"{BE_BASE_URL}/liveboard/", params) except TransportAPIError as e: logger.error(f"Belgium liveboard fetch failed: {e}", exc_info=True) raise
  • tools/be.py:69-72 (registration)
    MCP decorator that registers the tool with its name and description.
    @mcp.tool( name="be_get_departures", description="Get live departure board for a Belgian train station." )
  • tools/be.py:107-112 (registration)
    The register_be_tools function returns a list including the be_get_departures handler 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