trend_analysis
Analyse the long-term trend in a pollutant near a location.
Uses Theil-Sen slope estimation with Mann-Kendall significance testing to determine whether air quality is improving, worsening, or stable. Robust to outliers and missing data.
Returns a 'summary' with plain-English trend description and statistical details. Present the summary to users first.
Args:
location: Postcode, place name, or "lat,lon".
pollutant: Pollutant to analyse — "NO2", "PM2.5", "PM10", "O3" (default "NO2").
years: Number of years of data to analyse (default 5, range 2–5).
Requests outside this range are clamped; the response includes
metadata.years_clamped and a note in summary when so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| years | No | ||
| location | Yes | ||
| pollutant | No | NO2 |