fi_compare_weather
Compare current weather conditions between two Finnish locations side by side for planning and analysis.
Instructions
Compare current weather between two Finnish locations side by side.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location1 | Yes | First location (city name or coordinates) | |
| location2 | Yes | Second location |
Implementation Reference
- src/servers/finnish-weather.js:204-244 (handler)Registration and handler implementation for the 'fi_compare_weather' MCP tool. It fetches weather data for two locations using 'openMeteoFetch' and returns a side-by-side comparison.
server.tool( "fi_compare_weather", "Compare current weather between two Finnish locations side by side.", { location1: z.string().describe("First location (city name or coordinates)"), location2: z.string().describe("Second location"), }, async ({ location1, location2 }) => { try { const [loc1, loc2] = await Promise.all([getLocation(location1), getLocation(location2)]); const [data1, data2] = await Promise.all([ openMeteoFetch({ latitude: loc1.lat, longitude: loc1.lon, current: "temperature_2m,apparent_temperature,precipitation,snowfall,weather_code,wind_speed_10m,cloud_cover", }), openMeteoFetch({ latitude: loc2.lat, longitude: loc2.lon, current: "temperature_2m,apparent_temperature,precipitation,snowfall,weather_code,wind_speed_10m,cloud_cover", }), ]); const c1 = data1.current, c2 = data2.current; const wx1 = WMO_CODES[c1.weather_code] || "", wx2 = WMO_CODES[c2.weather_code] || ""; const lines = [ `## Weather Comparison\n`, `| | ${loc1.name} | ${loc2.name} |`, `|---|---|---|`, `| **Conditions** | ${wx1} | ${wx2} |`, `| **Temperature** | ${c1.temperature_2m}°C | ${c2.temperature_2m}°C |`, `| **Feels like** | ${c1.apparent_temperature}°C | ${c2.apparent_temperature}°C |`, `| **Wind** | ${c1.wind_speed_10m} km/h | ${c2.wind_speed_10m} km/h |`, `| **Cloud cover** | ${c1.cloud_cover}% | ${c2.cloud_cover}% |`, `| **Precipitation** | ${c1.precipitation} mm | ${c2.precipitation} mm |`, c1.snowfall > 0 || c2.snowfall > 0 ? `| **Snowfall** | ${c1.snowfall} cm | ${c2.snowfall} cm |` : null, `\n*Open-Meteo*`, ].filter(Boolean); return { content: [{ type: "text", text: lines.join("\n") }] }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true }; } } );