list_hydro_stations
Retrieve a comprehensive list of Swiss hydrological monitoring stations for rivers and lakes from BAFU data.
Instructions
List all available BAFU hydrological monitoring stations (rivers and lakes) in Switzerland
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/modules/weather.ts:229-235 (handler)Handler logic for list_hydro_stations tool.
case "list_hydro_stations": { const url = buildUrl(`${BASE}/hydro/locations`, { app: "mcp-swiss" }); const data = await fetchJSON<ApiResponse>(url); const payload = (data?.payload ?? {}) as Record<string, StationEntry>; const stations = compactHydroStations(payload); return JSON.stringify({ count: Object.keys(stations).length, stations }); } - src/modules/weather.ts:99-106 (schema)Tool registration and schema definition for list_hydro_stations.
{ name: "list_hydro_stations", description: "List all available BAFU hydrological monitoring stations (rivers and lakes) in Switzerland", inputSchema: { type: "object", properties: {}, }, }, - src/modules/weather.ts:147-158 (helper)Helper function to format hydro station data.
function compactHydroStations(payload: Record<string, StationEntry>): Record<string, string> { const result: Record<string, string> = {}; for (const s of Object.values(payload)) { const id = s.details?.id ?? s.name; const name = s.details?.name ?? id; const water = s.details?.["water-body-name"]; const type = s.details?.["water-body-type"]; const suffix = [water, type].filter(Boolean).join(", "); result[id] = suffix ? `${name} (${suffix})` : name; } return result; }