Skip to main content
Glama

get_weather

Retrieve current weather conditions for Swiss locations using MeteoSwiss station codes like BER, ZUE, or LUG.

Instructions

Get current weather conditions at a Swiss MeteoSwiss station (e.g. BER=Bern, ZUE=Zürich, LUG=Lugano)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYesStation code (e.g. BER, ZUE, LUG, GVE, SMA)

Implementation Reference

  • The handler implementation for the "get_weather" tool, which fetches data from the MeteoSwiss API and formats the response.
    case "get_weather": {
      const url = buildUrl(`${BASE}/smn/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 ts = payload[0]?.timestamp;
        const readings: Record<string, number> = {};
        for (const p of payload) {
          const key = PARAM_NAMES[p.par] ?? p.par;
          readings[key] = p.val;
        }
        return JSON.stringify({
          station: args.station,
          timestamp: toISO(ts),
          ...readings,
          source: "MeteoSwiss via SwissMetNet",
        });
      }
      return JSON.stringify(data, null, 2);
    }
  • The definition and input schema for the "get_weather" tool.
    {
      name: "get_weather",
      description: "Get current weather conditions at a Swiss MeteoSwiss station (e.g. BER=Bern, ZUE=Zürich, LUG=Lugano)",
      inputSchema: {
        type: "object",
        required: ["station"],
        properties: {
          station: { type: "string", description: "Station code (e.g. BER, ZUE, LUG, GVE, SMA)" },
        },
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the data source and station codes but does not describe response format, error conditions, rate limits, or whether this is a read-only operation. The description adds minimal behavioral context beyond the basic purpose.

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?

The description is a single, efficient sentence that immediately states the tool's purpose, scope, and provides helpful examples. Every element serves a purpose with zero wasted words, making it easy to parse and understand quickly.

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

Completeness3/5

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

For a simple single-parameter tool with no output schema and no annotations, the description provides adequate basic context about what the tool does and parameter examples. However, it lacks information about response format, error handling, and behavioral characteristics that would be helpful for an AI agent to use this tool effectively.

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 the 'station' parameter with examples. The description adds marginal value by reinforcing the station code concept with additional examples (BER, ZUE, LUG), but doesn't provide additional semantic context beyond what's in 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 tool's purpose with a specific verb ('Get') and resource ('current weather conditions'), specifies the data source ('Swiss MeteoSwiss station'), and distinguishes it from sibling tools like 'get_weather_history' and 'list_weather_stations' by focusing on current conditions at a specific station.

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

Usage Guidelines3/5

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

The description implies usage context by specifying Swiss MeteoSwiss stations and providing station code examples, but does not explicitly state when to use this tool versus alternatives like 'get_weather_history' or 'get_nearby_stations'. No explicit exclusions or prerequisites are mentioned.

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