get_nearby_stations
Find Swiss public transport stations near specific coordinates by providing longitude and latitude. Returns stations within a specified distance limit.
Instructions
Find Swiss public transport stations near given coordinates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Longitude (WGS84) | |
| y | Yes | Latitude (WGS84) | |
| limit | No | Number of results (default: 10) | |
| distance | No | Max distance in meters |
Implementation Reference
- src/modules/transport.ts:243-251 (handler)The handler implementation for get_nearby_stations, which calls the locations endpoint with coordinates.
case "get_nearby_stations": { const url = buildUrl(`${BASE}/locations`, { x: args.x as number, y: args.y as number, type: "station", }); const data = await fetchJSON<{ stations: Station[] }>(url); return JSON.stringify(data.stations.map(slimStation)); } - src/modules/transport.ts:172-184 (schema)The schema definition for get_nearby_stations tool.
name: "get_nearby_stations", description: "Find Swiss public transport stations near given coordinates", inputSchema: { type: "object", required: ["x", "y"], properties: { x: { type: "number", description: "Longitude (WGS84)" }, y: { type: "number", description: "Latitude (WGS84)" }, limit: { type: "number", description: "Number of results (default: 10)" }, distance: { type: "number", description: "Max distance in meters" }, }, }, },