get_water_level
Retrieve current water level and temperature data for Swiss rivers and lakes using hydrological station IDs.
Instructions
Get current river or lake water level and temperature at a Swiss hydrological station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| station | Yes | Hydro station ID (e.g. 2135 for Aare/Bern, 2243 for Rhine/Basel) |
Implementation Reference
- src/modules/weather.ts:214-227 (handler)The handler implementation for the get_water_level tool, which fetches latest hydrological data from the API and formats the response.
case "get_water_level": { const url = buildUrl(`${BASE}/hydro/latest`, { locations: args.station as string, app: "mcp-swiss", version: "0.1.0", }); const data = await fetchJSON<ApiResponse>(url); const payload = data?.payload; if (Array.isArray(payload)) { const readings = extractReadings(payload); return JSON.stringify({ station: args.station, readings }); } return JSON.stringify(data, null, 2); } - src/modules/weather.ts:88-98 (schema)The tool registration and schema definition for get_water_level within the weatherTools list.
{ name: "get_water_level", description: "Get current river or lake water level and temperature at a Swiss hydrological station", inputSchema: { type: "object", required: ["station"], properties: { station: { type: "string", description: "Hydro station ID (e.g. 2135 for Aare/Bern, 2243 for Rhine/Basel)" }, }, }, },