Skip to main content
Glama

get_water_history

Retrieve historical water level data for Swiss hydrological stations to analyze river and lake trends over specified date ranges.

Instructions

Get historical river/lake water level data for a Swiss hydrological station

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYesHydro station ID
start_dateYesStart date YYYY-MM-DD
end_dateYesEnd date YYYY-MM-DD

Implementation Reference

  • The handler function for 'get_water_history' which constructs the API request to the BAFU hydrological historical data endpoint and formats the response.
    case "get_water_history": {
      const url = buildUrl(`${BASE}/hydro/daterange`, {
        locations: args.station as string,
        startdt: args.start_date as string,
        enddt: args.end_date as string,
        app: "mcp-swiss",
        version: "0.1.0",
      });
      const data = await fetchJSON<ApiResponse>(url);
      const payload = data?.payload;
      if (Array.isArray(payload)) {
        const records = extractReadings(payload);
        return JSON.stringify({ station: args.station, count: records.length, data: records });
      }
      return JSON.stringify(data, null, 2);
    }
  • The definition of the 'get_water_history' tool, including its name, description, and required parameters (station, start_date, end_date).
      name: "get_water_history",
      description: "Get historical river/lake water level data for a Swiss hydrological station",
      inputSchema: {
        type: "object",
        required: ["station", "start_date", "end_date"],
        properties: {
          station: { type: "string", description: "Hydro station ID" },
          start_date: { type: "string", description: "Start date YYYY-MM-DD" },
          end_date: { type: "string", description: "End date YYYY-MM-DD" },
        },
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vikramgorla/mcp-swiss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server