Skip to main content
Glama

get_departures

Retrieve live departure times from Swiss transport stations to plan journeys and check schedules.

Instructions

Get live departures from a Swiss transport station

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYesStation name
limitNoNumber of departures (default: 10)
datetimeNoDateTime YYYY-MM-DDTHH:MM (default: now)

Implementation Reference

  • The handler function that executes the 'get_departures' tool by calling the /stationboard API endpoint with type="departure".
    case "get_departures": {
      const url = buildUrl(`${BASE}/stationboard`, {
        station: args.station as string,
        limit: args.limit as number,
        datetime: args.datetime as string,
        type: "departure",
      });
      const data = await fetchJSON<{ station: Station; stationboard: BoardEntry[] }>(url);
      return JSON.stringify({
        station: data.station?.name,
        departures: data.stationboard.map(slimBoardEntry),
      });
    }
  • The input schema definition for the 'get_departures' tool.
    {
      name: "get_departures",
      description: "Get live departures from a Swiss transport station",
      inputSchema: {
        type: "object",
        required: ["station"],
        properties: {
          station: { type: "string", description: "Station name" },
          limit: { type: "number", description: "Number of departures (default: 10)" },
          datetime: { type: "string", description: "DateTime YYYY-MM-DDTHH:MM (default: now)" },
        },
      },
    },

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/vikramgorla/mcp-swiss'

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