fi_current_weather
Retrieve current weather conditions for Finnish locations including temperature, wind, precipitation, humidity, and cloud cover data.
Instructions
Get current weather conditions for a location in Finland. Includes temperature, wind, precipitation, humidity, and cloud cover.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | Finnish city name (e.g. 'Helsinki', 'Tampere', 'Rovaniemi', 'Levi') or lat,lon coordinates |
Implementation Reference
- src/servers/finnish-weather.js:118-144 (handler)The handler function for `fi_current_weather` tool which fetches and formats weather data.
async ({ location }) => { try { const loc = await getLocation(location); const data = await openMeteoFetch({ latitude: loc.lat, longitude: loc.lon, current: "temperature_2m,relative_humidity_2m,apparent_temperature,precipitation,weather_code,wind_speed_10m,wind_direction_10m,wind_gusts_10m,surface_pressure,cloud_cover,snowfall", }); const c = data.current; const weather = WMO_CODES[c.weather_code] || `Code ${c.weather_code}`; const lines = [ `## ${loc.name} — Current Weather`, `**Conditions:** ${weather}`, `**Temperature:** ${c.temperature_2m}°C (feels like ${c.apparent_temperature}°C)`, `**Humidity:** ${c.relative_humidity_2m}%`, `**Wind:** ${c.wind_speed_10m} km/h from ${c.wind_direction_10m}° (gusts ${c.wind_gusts_10m} km/h)`, `**Pressure:** ${c.surface_pressure} hPa`, `**Cloud cover:** ${c.cloud_cover}%`, `**Precipitation:** ${c.precipitation} mm`, c.snowfall > 0 ? `**Snowfall:** ${c.snowfall} cm` : null, `\n*Open-Meteo — ${c.time} (Europe/Helsinki)*`, ].filter(Boolean); return { content: [{ type: "text", text: lines.join("\n") }] }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true }; } } - src/servers/finnish-weather.js:112-117 (registration)Registration of the `fi_current_weather` tool.
server.tool( "fi_current_weather", "Get current weather conditions for a location in Finland. Includes temperature, wind, precipitation, humidity, and cloud cover.", { location: z.string().describe("Finnish city name (e.g. 'Helsinki', 'Tampere', 'Rovaniemi', 'Levi') or lat,lon coordinates"), },