Skip to main content
Glama

get_weather_history

Retrieve historical weather data for Swiss stations by specifying station code and date range. Access past weather conditions for analysis or planning purposes.

Instructions

Get historical weather data for a Swiss station

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYesStation code (e.g. BER)
start_dateYesStart date YYYY-MM-DD
end_dateYesEnd date YYYY-MM-DD

Implementation Reference

  • The handler logic for "get_weather_history" which fetches historical weather data from the MeteoSwiss API.
    case "get_weather_history": {
      const url = buildUrl(`${BASE}/smn/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 schema definition for the "get_weather_history" tool.
      name: "get_weather_history",
      description: "Get historical weather data for a Swiss station",
      inputSchema: {
        type: "object",
        required: ["station", "start_date", "end_date"],
        properties: {
          station: { type: "string", description: "Station code (e.g. BER)" },
          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