Skip to content

Skill: Marine weather

$0.007 per callUSDC via x402POST /api/skill/marine-weather

Marine weather for a point at sea in one call: the Douglas sea state, swell, sea temperature, wind at sea and the stretches of hours inside your limits...

Category: Skill packsTags: skill-pack workflow marine-weatherPack overview

Try in playground →

Details

Marine weather for a point at sea in one call: the Douglas sea state, swell, sea temperature, wind at sea and the stretches of hours inside your limits, with the land forecast and today's daylight. Marine weather skill pack: one x402 payment runs 3 underlying tools (marine-forecast, weather-daily, sun-times); partial-success per step. Weather data by Open-Meteo.com (CC BY 4.0). Wave data from Meteo-France (E.U. Copernicus Marine Service Information), ECMWF, NOAA NCEP and DWD. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.

Parameters

NameTypeRequiredDescription
latstringyesLatitude of a point at sea or on the open coast (e.g. 43.65 off Nice) Also accepted as latitude. The example sends 43.65.
lonstringyesLongitude of the point (e.g. 7.3 off Nice) Also accepted as lng, long, longitude. The example sends 7.3.

Example request

curl -i -X POST https://agent402.tools/api/skill/marine-weather \
  -H "Content-Type: application/json" \
  -d '{"lat":"43.65","lon":"7.3"}'

Watch a call get paid

RequestPOST /api/skill/marine-weather
402$0.007 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "pack": "marine-weather",
  "args": {
    "lat": "43.65",
    "lon": "7.3"
  },
  "steps": [
    {
      "slug": "marine-forecast",
      "ok": true,
      "result": {}
    },
    {
      "slug": "weather-daily",
      "ok": true,
      "result": {}
    },
    {
      "slug": "sun-times",
      "ok": true,
      "result": {}
    }
  ],
  "summary": "3/3 steps succeeded"
}
FieldTypeAlways presentIn the example
packstringyesmarine-weather
argsobjectyes2 fields: lat, lon
stepsarray of objectsyes3 items in the example
summarystringyes3/3 steps succeeded

From an MCP client

catalog.call {
  "slug": "skill-marine-weather",
  "params": {
    "lat": "43.65",
    "lon": "7.3"
  }
}

Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.19.2): pays from a wallet or AGENT402_CREDITS_KEY.

Errors and behavior

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.007" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/skill/marine-weather", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "lat": "43.65",
    "lon": "7.3"
  }),
});

Get a wallet or run npx -y agent402-mcp@0.19.2 wallet new.

The quote (Python)

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/api/skill/marine-weather", method="POST", data="{\"lat\":\"43.65\",\"lon\":\"7.3\"}".encode(), headers={"Content-Type": "application/json"})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Related tools