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
| Name | Required | Description | Default |
|---|---|---|---|
| station | Yes | Station name | |
| limit | No | Number of departures (default: 10) | |
| datetime | No | DateTime YYYY-MM-DDTHH:MM (default: now) |
Implementation Reference
- src/modules/transport.ts:215-227 (handler)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), }); } - src/modules/transport.ts:145-157 (schema)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)" }, }, }, },