Skip to main content
Glama
robobobby
by robobobby

se_current_weather

Get current weather data for Swedish locations using SMHI, including temperature, wind, precipitation, and humidity.

Instructions

Get current weather for a location in Sweden using SMHI (Swedish Meteorological and Hydrological Institute). Includes temperature, wind, precipitation, humidity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesSwedish city name (e.g. 'Stockholm', 'Malmö', 'Gothenburg', 'Kiruna') or lat,lon coordinates

Implementation Reference

  • The handler function that executes the logic for 'se_current_weather' by fetching location data and forecasting weather from SMHI.
    async ({ location }) => {
      try {
        const loc = await getLocation(location);
        const data = await fetchForecast(loc.lat, loc.lon);
        const ts = data.timeSeries;
        if (!ts?.length) throw new Error("No forecast data");
    
        // Find the entry closest to now
        const now = Date.now();
        let closest = ts[0];
        let minDiff = Math.abs(new Date(ts[0].validTime).getTime() - now);
        for (const entry of ts.slice(1, 10)) {
          const diff = Math.abs(new Date(entry.validTime).getTime() - now);
          if (diff < minDiff) { closest = entry; minDiff = diff; }
        }
    
        const p = closest.parameters;
        const temp = getParam(p, "t");
        const wind = getParam(p, "ws");
        const gust = getParam(p, "gust");
        const windDir = getParam(p, "wd");
        const humidity = getParam(p, "r");
        const pressure = getParam(p, "msl");
        const cloud = getParam(p, "tcc_mean");
        const wsymb = getParam(p, "Wsymb2");
        const precip = getParam(p, "pmean");
    
        const lines = [
          `## ${loc.name} — Current Weather`,
          `**Conditions:** ${WSYMB2[wsymb] || `Code ${wsymb}`}`,
          `**Temperature:** ${temp}°C`,
          `**Humidity:** ${humidity}%`,
          `**Wind:** ${wind} m/s from ${windDir}° (gusts ${gust} m/s)`,
          `**Pressure:** ${pressure} hPa`,
          `**Cloud cover:** ${cloud != null ? Math.round(cloud * 12.5) + "%" : "N/A"}`,
          precip != null ? `**Precipitation:** ${precip} mm/h` : null,
          `\n*SMHI — ${closest.validTime}*`,
        ].filter(Boolean);
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      } catch (err) {
        return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
      }
  • The registration of the 'se_current_weather' tool along with its schema and description.
    server.tool(
      "se_current_weather",
      "Get current weather for a location in Sweden using SMHI (Swedish Meteorological and Hydrological Institute). Includes temperature, wind, precipitation, humidity.",
      {
        location: z.string().describe("Swedish city name (e.g. 'Stockholm', 'Malmö', 'Gothenburg', 'Kiruna') or lat,lon coordinates"),
      },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the data source (SMHI) and what data is included, but doesn't disclose behavioral traits like rate limits, authentication needs, error handling, or response format. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. It includes necessary details (Sweden, SMHI, weather elements) without unnecessary elaboration. Could be slightly improved by structuring usage guidance separately.

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?

Given no annotations and no output schema, the description provides basic purpose and data elements but lacks important context about behavior, response format, and error conditions. It's minimally adequate for a simple weather lookup tool but leaves gaps that could hinder effective use.

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 'location' parameter. The description doesn't add any parameter-specific information beyond what's in the schema. Baseline score of 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/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: 'Get current weather for a location in Sweden using SMHI' with specific details like temperature, wind, precipitation, and humidity. It distinguishes from siblings by specifying Sweden and SMHI, though it doesn't explicitly contrast with other weather tools like 'se_weather_forecast'.

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 for current weather in Sweden, but provides no explicit guidance on when to use this tool versus alternatives like 'se_weather_forecast' or other country-specific weather tools. It mentions the data source (SMHI) which gives some context, but lacks clear when-to-use or when-not-to-use instructions.

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/robobobby/mcp-nordic'

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