open-meteo-weather
npx machina-cli add skill IvanCampos/agents/open-meteo-weather --openclawOpen-Meteo Weather
Overview
Fetch current weather from Open-Meteo with a tiny, deterministic flow. Prefer the script for repeatable calls; fall back to raw URL construction when asked for a direct API call.
Quick Start
- Use the script for location names:
/Users/ivancampos/.codex/skills/open-meteo-weather/scripts/open_meteo_current.py --location "Boston, MA"
- Use the script for explicit coordinates:
/Users/ivancampos/.codex/skills/open-meteo-weather/scripts/open_meteo_current.py --lat 42.3601 --lon -71.0589
- Provide a direct API call when the user requests a raw URL:
https://api.open-meteo.com/v1/forecast?latitude=42.3601&longitude=-71.0589¤t_weather=true&timezone=auto
Workflow
- Determine input type: location name or lat/lon.
- If location name is provided, geocode first (use the Open-Meteo geocoding API).
- Call the forecast endpoint with
current_weather=trueandtimezone=auto. - Return JSON with
locationand a normalizedcurrent_weatherobject.- Include both
temperature_candtemperature_f. - Use keys:
windspeed_kmh,winddirection_deg,weathercode,is_day,time,interval.
- Include both
Examples
- “Get current weather in Boston” → geocode, then call forecast.
- “Use this URL for Medford, MA” → provide direct forecast URL with given lat/lon.
Resources
scripts/
open_meteo_current.py: CLI for location or lat/lon; prints JSON withlocationandcurrent_weather.
references/
open_meteo.md: endpoint and parameter quick reference.
Source
git clone https://github.com/IvanCampos/agents/blob/main/skills/open-meteo-weather/SKILL.mdView on GitHub Overview
Fetch current weather from Open-Meteo with a tiny, deterministic flow. Prefer the script for repeatable calls; fall back to raw URL construction when asked for a direct API call.
How This Skill Works
The skill determines if input is a location name or lat/lon. If a name is provided, it geocodes first using Open-Meteo's geocoding API, then calls the forecast endpoint with current_weather=true and timezone=auto. It returns a JSON object with location and a normalized current_weather containing temperature_c, temperature_f, winds, weathercode, is_day, time, and interval.
When to Use It
- Asking for current weather in a city name (e.g., Boston, MA).
- Providing latitude/longitude for a precise location.
- Automating weather checks in a script or bot with deterministic input.
- Requesting a raw API URL for quick testing or debugging.
- Needing a normalized output that includes both temperature scales and wind data.
Quick Start
- Step 1: Use the script for location names: /Users/ivancampos/.codex/skills/open-meteo-weather/scripts/open_meteo_current.py --location "Boston, MA"
- Step 2: Use the script for explicit coordinates: /Users/ivancampos/.codex/skills/open-meteo-weather/scripts/open_meteo_current.py --lat 42.3601 --lon -71.0589
- Step 3: Provide a direct API call when the user requests a raw URL: https://api.open-meteo.com/v1/forecast?latitude=42.3601&longitude=-71.0589¤t_weather=true&timezone=auto
Best Practices
- Use the script for repeatable calls when you have a city name or coordinates.
- Geocode city names first and consider caching results to reduce API usage.
- Return a JSON with location and a current_weather object; include temperature_c and temperature_f.
- Always query forecast with current_weather=true and timezone=auto for consistent data.
- Provide a direct API URL only when the user explicitly requests a raw URL.
Example Use Cases
- Get current weather in Boston by using the script (city name input).
- Fetch Medford, MA weather by providing lat=42.3601 and lon=-71.0589.
- Provide the raw Open-Meteo forecast URL for a quick test of Boston’s current conditions.
- Integrate the tool into a CLI utility that prints location and current_weather.
- Feed the normalized output into a frontend widget showing temp_C, temp_F, and wind data.