Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 });
    }
  • 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: {},
      },
    },
  • 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;
    }

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