OpenWeather tool
The OpenWeather tool gives an agent weather and geo data — current conditions, a 5-day/3-hour forecast, geocoding (city ↔ coordinates), and air quality — behind a single action it picks per call. One credential: a free OpenWeather API key. It's read-only.
units: metric (°C, m/s) or units: imperial (°F, mph) for human-readable temperatures. The schema nudges the agent to do this, but it's worth knowing.
Connect OpenWeather
- Sign up free at openweathermap.org.
- Go to My API keys (home.openweathermap.org/api_keys).
- Copy the default key (or generate one named "Hania") and paste it into the API Key field. Stored encrypted, never shown again.
One Call: the
one_call action needs the free "One Call by Call" subscription on your OpenWeather account. The other 8 actions work on any free key.
Actions (9)
current_weather— current conditions for a place. Needs a location (q/zip/ city id /lat+lon).forecast— 5-day / 3-hour forecast. Needs a location.geocode— city name → coordinates (+ matches). Needsq.reverse_geocode— coordinates → place name. Needslat,lon.zip_lookup— postal code → place + coordinates. Needszip.air_pollution— current AQI + pollutants. Needslat,lon.air_pollution_forecast— 4-day hourly air quality. Needslat,lon.air_pollution_history— historical air quality. Needslat,lon,start,end.one_call— current + minutely + hourly + daily + alerts in one call (needs the "One Call by Call" subscription). Needslat,lon.
How location works
For current_weather / forecast, give a place one way: a city name in q (e.g. London or London,GB), a zip (E14,GB), a city id, or lat+lon. Air quality and one_call require coordinates — so for a city name the agent geocodes first, then queries; the tool makes this a natural two-step.
Field reference
- units —
metricorimperial(defaultstandard= Kelvin). - lang — language for weather descriptions (
en,fr,es,de…). - q (geocode) — city name, optional US state, optional country code —
Paris,TX,US. - limit — geocoding: how many matches to return (up to 5).
- zip — postal code + country,
90210,US. - start / end — air-quality history window, as Unix seconds (UTC).
- exclude —
one_call: parts to drop — any ofcurrent,minutely,hourly,daily,alerts.
Common recipes
- Current weather for a city —
current_weatherwithqandunits: metric. - Will it rain tomorrow? —
forecastfor the location and read the next day's 3-hour blocks. - Air quality near me —
geocodethe city →air_pollutionwith the returnedlat/lon. - Rich forecast with alerts —
one_call(with the subscription enabled).
Errors & limits
OpenWeather returns real HTTP status codes plus a {cod, message} body (surfaced verbatim):
- 401 — key not active yet (wait for activation), or
one_callneeds the subscription. - 404 — "city not found"; refine
q(add a country code) or geocode first. - 429 — rate limit (free plan is 60 calls/min).
- 400 — bad parameters.
Classification & lifecycle
This tool is read-only — no writes, nothing destructive, nothing to confirm. It's post-call-hook eligible (runs outside the LLM turn).