Weather risk brief (many sites)
POST /api/weather-risk-briefOne 7-day weather risk read for up to 50 sites in one call: per site the daily forecast, hour-by-hour checks for frost, heat, high gusts, intense rain and snow over the next 168 hours, current air quality, the same dates a year earlier, and the ensemble probability of 10 mm or more of rain on the wettest forecast day; each site gets a 0-100 risk score from the signals present and the sites are ranked. Send POST /api/weather-risk-brief with the required field sites and pay quoted per request from $0.018 over x402 or MPP (there is no free tier). It returns a JSON object with product, generatedAt, units, sites, portfolio and 6 more.
Priced per site: the five weather tools it runs (weather-daily, weather-thresholds, weather-air-quality, weather-history, weather-probability) less 10%, $0.018 a site, quoted in the 402 for the sites you send. A site is {"lat","lon"} or {"place"} with an optional "name". Deterministic code over the forecast data, no model. Weather data by Open-Meteo.com (CC BY 4.0).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sites | array of object | yes | 1 to 50 sites, each {"lat","lon"} or {"place"} with an optional "name" (a place name string also works) |
units | string | no | celsius (default; wind km/h) or fahrenheit (wind mph); rain is always mm |
Example request
curl -i -X POST https://agent402.tools/api/weather-risk-brief \
-H "Content-Type: application/json" \
-d '{"sites":[{"name":"Chicago DC","lat":41.88,"lon":-87.63},{"name":"Houston DC","lat":29.76,"lon":-95.37},{"name":"Denver DC","lat":39.74,"lon":-104.99},{"name":"Miami DC","lat":25.76,"lon":-80.19},{"name":"Seattle DC","lat":47.61,"lon":-122.33},{"name":"Phoenix DC","lat":33.45,"lon":-112.07}]}'Without payment this returns HTTP 402 Payment Required with the exact price for weather-risk-brief; any x402 v2 or MPP client pays it and retries.
Watch a call get paid
POST /api/weather-risk-brieffrom $0.018 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"product": "weather-risk-brief",
"generatedAt": "2026-11-18T23:40:00.000Z",
"units": "celsius",
"sites": 6,
"portfolio": {
"sitesWithFlag": {
"frost": 2,
"heat": 0,
"highGusts": 1,
"intenseRain": 1,
"snow": 1,
"heavyRainLikely": 1,
"poorAir": 0
},
"highestRisk": {
"index": 2,
"site": "Denver DC",
"riskScore": 55,
"flags": [
"frost",
"highGusts",
"snow"
]
},
"meanRiskScore": 20.8
},
"ranking": [
{
"index": 2,
"site": "Denver DC",
"riskScore": 55,
"flags": [
"frost",
"highGusts",
"snow"
]
},
{
"index": 0,
"site": "Chicago DC",
"riskScore": 30,
"flags": [
"frost",
"heavyRainLikely"
]
}
],
"rows": [
{
"site": {
"name": "Denver DC",
"lat": 39.74,
"lon": -104.99
},
"riskScore": 55,
"flags": [
"frost",
"highGusts",
"snow"
],
"forecast": {
"from": "2026-11-18",
"to": "2026-11-24",
"days": 7,
"tempMax": 14.2,
"tempMin": -9.1,
"precipTotal": 6.3,
"wettestDay": {
"date": "2026-11-21",
"precipSum": 4.8,
"precipProbability": 61
},
"gustiestDay": {
"date": "2026-11-21",
"windGusts": 74.2
},
"uvMax": 3.1,
"unit": "°C",
"windUnit": "km/h"
},
"risks": {
"frost": {
"rule": "temperature < 0 °C",
"met": true,
"firstAt": "2026-11-19T03:00",
"hoursMet": 41
},
"highGusts": {
"rule": "wind_gusts >= 70 km/h",
"met": true,
"firstAt": "2026-11-21T13:00",
"hoursMet": 3
}
},
"heavyRain": {
"date": "2026-11-21",
"thresholdMm": 10,
"probability": 0.0732,
"members": 82
},
"airQuality": {
"usAqi": 41,
"category": "Good",
"pm25": 6.2,
"at": "2026-11-18T23:00"
},
"vsLastYear": {
"from": "2025-11-19",
"to": "2025-11-25",
"tempMaxMeanDelta": -2.4,
"precipTotalDelta": 3.1
}
}
],
"method": "riskScore adds frost 15, heat 20, highGusts 25, intenseRain 15, snow 15, heavyRainLikely 15, poorAir 10 points (capped at 100) for each signal present.",
"pricing": {
"units": 6,
"unitPartsUsd": 0.019,
"priceUsd": 0.103,
"rule": "the sum of each unit's tools (weather-daily, weather-thresholds, weather-air-quality, weather-history, weather-probability) times the units, less 10%, rounded up to $0.001"
},
"source": "computed from Open-Meteo forecast, air quality, archive and ensemble data (CC BY 4.0)",
"credits": [
"Weather data by Open-Meteo.com (CC BY 4.0)."
]
}| Field | Type | Always present | In the example |
|---|---|---|---|
product | string | yes | weather-risk-brief |
generatedAt | string | yes | 2026-11-18T23:40:00.000Z |
units | string | yes | celsius |
sites | number | yes | 6 |
portfolio | object | yes | 3 fields: sitesWithFlag, highestRisk, meanRiskScore |
ranking | array of objects | yes | 2 items in the example |
rows | array of objects | yes | 1 item in the example |
method | string | yes | riskScore adds frost 15, heat 20, highGusts 25, intenseRain 15, snow 15, heav... |
pricing | object | yes | 4 fields: units, unitPartsUsd, priceUsd, rule |
source | string | yes | computed from Open-Meteo forecast, air quality, archive and ensemble data (CC... |
credits | array of string | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "weather-risk-brief",
"params": {
"sites": [
{
"name": "Chicago DC",
"lat": 41.88,
"lon": -87.63
},
{
"name": "Houston DC",
"lat": 29.76,
"lon": -95.37
},
{
"name": "Denver DC",
"lat": 39.74,
"lon": -104.99
},
{
"name": "Miami DC",
"lat": 25.76,
"lon": -80.19
},
{
"name": "Seattle DC",
"lat": 47.61,
"lon": -122.33
},
{
"name": "Phoenix DC",
"lat": 33.45,
"lon": -112.07
}
]
}
}The hosted connector at https://agent402.tools/mcp needs a payment for weather-risk-brief; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.14.0.
Errors and behavior
sitesis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Priced per request: the 402 quotes this body, between $0.018 and $0.855.
- A
GETorHEADto /api/weather-risk-brief returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.855" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/weather-risk-brief", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"sites": [
{
"name": "Chicago DC",
"lat": 41.88,
"lon": -87.63
},
{
"name": "Houston DC",
"lat": 29.76,
"lon": -95.37
},
{
"name": "Denver DC",
"lat": 39.74,
"lon": -104.99
},
{
"name": "Miami DC",
"lat": 25.76,
"lon": -80.19
},
{
"name": "Seattle DC",
"lat": 47.61,
"lon": -122.33
},
{
"name": "Phoenix DC",
"lat": 33.45,
"lon": -112.07
}
]
}),
});Related tools
Sharpe ratio
Risk-adjusted return: (mean return - risk-free rate) / sample standard deviation of returns (n-1).
Daily forecast (global)
7-day daily weather forecast for any location: high/low temp, precipitation sum and probability, max wind, UV index.
Weather forecast (US)
Multi-period weather forecast for a US location from api.weather.gov (NWS, public domain).
Hourly forecast (global)
48-hour hourly weather forecast for any location: temperature, precipitation probability and amount, wind, cloud cover.
Weather probability (ensemble)
Probability that a day's weather meets a condition, from up to 82 ensemble members (ECMWF IFS and NOAA GEFS): a high.
Weather threshold check
Check the hourly forecast against your own rules: for each rule (a variable, a comparison, a value) get whether it is.