Skip to main content
Glama

get_snow_measurements

Retrieve detailed snow and weather measurements from Swiss SLF stations, including snow depth, temperature, humidity, wind, and radiation data for monitoring and analysis.

Instructions

Get detailed snow and weather measurements for a specific SLF station. IMIS stations return 30-min data (snow depth, temperature, humidity, wind, radiation). Study plots return daily data (snow depth, new snow, water equivalent). Use list_snow_stations to find station codes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
station_codeYesStation code (e.g. DAV2, WFJ2, 4AO0). Use list_snow_stations to find codes.
typeNoStation type: "imis" (default) or "study-plot". Determines which API endpoint to query.

Implementation Reference

  • The handler function `handleGetSnowMeasurements` processes the request for snow measurements for a specific station, handles different station types (IMIS vs study-plot), fetches data from the SLF API, and formats the output.
    async function handleGetSnowMeasurements(
      args: Record<string, unknown>
    ): Promise<string> {
      const stationCode = args.station_code;
      if (typeof stationCode !== "string" || !stationCode.trim()) {
        throw new Error("station_code is required");
      }
      const code = stationCode.trim();
      const stationType =
        typeof args.type === "string" && args.type.trim().toLowerCase() === "study-plot"
          ? "study-plot"
          : "imis";
    
      if (stationType === "study-plot") {
        const measurements = await fetchJSON<StudyPlotMeasurement[]>(
          `${BASE}/study-plot/station/${encodeURIComponent(code)}/measurements`
        );
    
        const latest = measurements.slice(-10).reverse().map((m) => ({
          time: m.measure_date,
          snow_depth_cm: m.HS,
          new_snow_24h_cm: m.HN_1D,
          new_snow_water_equiv_mm: m.HNW_1D,
        }));
    
        return JSON.stringify({
          station_code: code,
          type: "study-plot",
          measurement_count: latest.length,
          measurements: latest,
          source: "WSL Institute for Snow and Avalanche Research SLF (CC BY 4.0)",
        });
      }
    
      // IMIS station
      const measurements = await fetchJSON<ImisMeasurement[]>(
        `${BASE}/imis/station/${encodeURIComponent(code)}/measurements`
      );
    
      // Return latest 10 measurements, most recent first, with readable field names
      const latest = measurements.slice(-10).reverse().map((m) => ({
        time: m.measure_date,
        snow_depth_cm: m.HS,
        air_temp_c: m.TA_30MIN_MEAN,
        humidity_pct: m.RH_30MIN_MEAN,
        surface_temp_c: m.TSS_30MIN_MEAN,
        ground_temp_0cm_c: m.TS0_30MIN_MEAN,
        reflected_radiation_w_m2: m.RSWR_30MIN_MEAN,
        wind_speed_m_s: m.VW_30MIN_MEAN,
        wind_gust_m_s: m.VW_30MIN_MAX,
        wind_direction_deg: m.DW_30MIN_MEAN,
      }));
    
      return JSON.stringify({
        station_code: code,
        type: "imis",
        measurement_count: latest.length,
        measurements: latest,
        fields: {
          snow_depth_cm: "Total snow depth (HS)",
          air_temp_c: "Air temperature 30-min mean",
          humidity_pct: "Relative humidity 30-min mean",
          surface_temp_c: "Snow surface temperature",
          reflected_radiation_w_m2: "Reflected shortwave radiation",
          wind_speed_m_s: "Wind speed 30-min mean",
          wind_gust_m_s: "Wind gust 30-min max",
          wind_direction_deg: "Wind direction 30-min mean",
        },
        source: "WSL Institute for Snow and Avalanche Research SLF (CC BY 4.0)",
      });
    }
  • The tool definition for `get_snow_measurements` includes its description and input schema.
        name: "get_snow_measurements",
        description:
          "Get detailed snow and weather measurements for a specific SLF station. " +
          "IMIS stations return 30-min data (snow depth, temperature, humidity, wind, radiation). " +
          "Study plots return daily data (snow depth, new snow, water equivalent). " +
          "Use list_snow_stations to find station codes.",
        inputSchema: {
          type: "object",
          required: ["station_code"],
          properties: {
            station_code: {
              type: "string",
              description:
                "Station code (e.g. DAV2, WFJ2, 4AO0). Use list_snow_stations to find codes.",
            },
            type: {
              type: "string",
              enum: ["imis", "study-plot"],
              description:
                'Station type: "imis" (default) or "study-plot". Determines which API endpoint to query.',
            },
          },
        },
      },
    ];
  • Registration of the tool within the `handleSnow` dispatcher.
    case "get_snow_measurements":
      return handleGetSnowMeasurements(args);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses behavioral traits such as data types (30-min vs. daily data) and station types (IMIS vs. study plots), but lacks details on permissions, rate limits, or response format. It doesn't contradict annotations since none exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It's appropriately sized with three sentences, front-loaded with the main purpose, followed by data specifics and a usage tip. Every sentence adds value without waste, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is fairly complete: it explains what data is returned, station types, and how to find codes. However, it could improve by detailing response format or error handling, especially since no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description adds context by explaining that 'type' determines data granularity (30-min vs. daily) and referencing 'list_snow_stations' for station codes, but doesn't provide additional syntax or format details beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'detailed snow and weather measurements for a specific SLF station', specifying it's for a 'specific' station. It distinguishes from sibling tools by mentioning 'list_snow_stations' for finding station codes, though not all siblings are directly related.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context on when to use this tool: for retrieving measurements from SLF stations, with an explicit alternative 'list_snow_stations' to find station codes. However, it doesn't specify when not to use it or compare with other weather-related tools like 'get_weather' or 'get_snow_conditions'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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