Skip to main content
Glama
robobobby
by robobobby

se_weather_forecast

Get weather forecasts for Swedish locations using SMHI data. Retrieve hourly weather predictions for up to 72 hours ahead to plan activities and prepare for changing conditions.

Instructions

Get weather forecast for a location in Sweden using SMHI. Returns hourly data for the next N hours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesSwedish city name or lat,lon coordinates
hoursNoHours ahead (default 24, max 72)

Implementation Reference

  • Implementation and registration of the 'se_weather_forecast' tool.
    server.tool(
      "se_weather_forecast",
      "Get weather forecast for a location in Sweden using SMHI. Returns hourly data for the next N hours.",
      {
        location: z.string().describe("Swedish city name or lat,lon coordinates"),
        hours: z.number().min(1).max(72).optional().describe("Hours ahead (default 24, max 72)"),
      },
      async ({ location, hours }) => {
        try {
          const loc = await getLocation(location);
          const data = await fetchForecast(loc.lat, loc.lon);
          const maxHours = hours || 24;
          const now = Date.now();
          const cutoff = now + maxHours * 3600000;
    
          const lines = [`## ${loc.name} — ${maxHours}h Forecast\n`];
          for (const entry of data.timeSeries) {
            const t = new Date(entry.validTime);
            if (t.getTime() > cutoff) break;
            if (t.getTime() < now - 3600000) continue;
    
            const time = t.toLocaleString("sv-SE", { timeZone: "Europe/Stockholm", weekday: "short", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
            const p = entry.parameters;
            const temp = getParam(p, "t");
            const wind = getParam(p, "ws");
            const wsymb = getParam(p, "Wsymb2");
            const precip = getParam(p, "pmean");
    
            lines.push(`**${time}:** ${temp}°C, ${WSYMB2[wsymb] || ""}, wind ${wind} m/s${precip > 0 ? `, ${precip} mm/h` : ""}`);
          }
          lines.push(`\n*SMHI Open Data*`);
          return { content: [{ type: "text", text: lines.join("\n") }] };
        } catch (err) {
          return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the data source ('SMHI') and that it returns hourly forecast data, but lacks details on error handling, rate limits, authentication needs, data freshness, or what happens with invalid inputs. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 concise and front-loaded, consisting of two clear sentences that efficiently convey the core functionality. There's no wasted verbiage, and it directly addresses what the tool does and what it returns. However, it could be slightly more structured by explicitly separating purpose from output details.

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 the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and output format but lacks details on behavioral traits, error cases, or usage context. Without annotations or an output schema, the agent has incomplete information about how to handle the tool effectively in real-world scenarios.

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%, with both parameters ('location' and 'hours') well-documented in the schema. The description adds minimal value beyond the schema, only implying that 'hours' controls the forecast duration ('next N hours'). No additional syntax, format details, or examples are provided, so the baseline score of 3 is appropriate given 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 weather forecast for a location in Sweden using SMHI. Returns hourly data for the next N hours.' It specifies the verb ('Get'), resource ('weather forecast'), geographic scope ('Sweden'), data source ('SMHI'), and output format ('hourly data'). However, it doesn't explicitly differentiate from sibling tools like 'se_current_weather' or other country-specific forecast tools, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'se_current_weather' (for current weather vs. forecast) or other country-specific forecast tools (e.g., 'dk_weather_forecast'), nor does it specify any prerequisites, exclusions, or contextual triggers for usage. The agent must infer usage from the description alone.

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