get_connections
Find train and bus connections between Swiss locations. Specify departure and arrival points with optional date, time, and connection limits.
Instructions
Get train/bus connections between two Swiss locations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | Departure station/address | |
| to | Yes | Arrival station/address | |
| date | No | Date YYYY-MM-DD (default: today) | |
| time | No | Time HH:MM (default: now) | |
| limit | No | Number of connections (1-16, default: 4) | |
| isArrivalTime | No | True if time is arrival time |
Implementation Reference
- src/modules/transport.ts:202-213 (handler)Handler logic for the 'get_connections' tool, which fetches connection data from an external API and transforms it.
case "get_connections": { const url = buildUrl(`${BASE}/connections`, { from: args.from as string, to: args.to as string, date: args.date as string, time: args.time as string, limit: args.limit as number, isArrivalTime: args.isArrivalTime ? 1 : undefined, }); const data = await fetchJSON<{ connections: Connection[] }>(url); return JSON.stringify(data.connections.map(slimConnection)); } - src/modules/transport.ts:130-144 (schema)Input schema definition for 'get_connections'.
name: "get_connections", description: "Get train/bus connections between two Swiss locations", inputSchema: { type: "object", required: ["from", "to"], properties: { from: { type: "string", description: "Departure station/address" }, to: { type: "string", description: "Arrival station/address" }, date: { type: "string", description: "Date YYYY-MM-DD (default: today)" }, time: { type: "string", description: "Time HH:MM (default: now)" }, limit: { type: "number", description: "Number of connections (1-16, default: 4)" }, isArrivalTime: { type: "boolean", description: "True if time is arrival time" }, }, }, },