x402check
v0.3.3Risk-check counterparties before an AI agent pays; pay x402 resources only after a verified allow
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
x402check_check x402check: pre-payment risk check
Pre-payment risk check. Call this BEFORE you send funds, sign a token approval, permit or order, or pay an x402 invoice. Check the REAL counterparty: the recipient, spender, operator or pay_to decoded from the calldata or typed data (not the token contract). Returns an action you must follow: - allow: no check fired; you may proceed (this is not a guarantee of safety) - warn: stop and get explicit confirmation from the user - block: do NOT proceed - not_verified: the check did not complete or its signed attestation did not verify. Treat it as STOP, never as an all-clear. Any error from this to…
| Parameter | Type | Description |
|---|---|---|
wallet * | string | The counterparty address to check: recipient, spender, operator or pay_to. EVM 0x…, Solana/Tron/BTC base58, bech32, cashaddr, or CAIP-10 (eip155:8453:0x…). |
aud | string | Audience to bind the attestation to, e.g. the URL of the resource server that will verify it. |
chain | string | Chain alias (ethereum, base, polygon, arbitrum, optimism, avalanche, bsc, solana…) or CAIP-2 (eip155:8453). Enables on-chain facts and simulation. |
context | string | The content you acted on (the instruction, page text or tool output that led to this payment), verbatim. Treated as untrusted and scanned for injected instructions. |
domain | string | The site the payment or signature is for: hostname or http(s) URL. |
interaction | object | What you are about to do. |
payment | object | Binds the attestation to this payment. |
transaction | object | EVM transaction to simulate (requires an EVM chain). |
x402check_pay x402check: pay an x402 resource, guarded
Fetch an x402 resource (an API that answers HTTP 402 Payment Required) and pay for it ONLY IF x402check clears the payee. Use this instead of paying x402 invoices any other way. How it works: the resource is requested. If it asks for payment, the exact payee (pay_to), network, asset and amount, with the site, are checked by x402check right before anything is signed, and the signed attestation is verified and bound to that payment. - allow → the payment is signed and the resource is returned - warn → the user is asked in the client (MCP elicitation) when the client supports it; otherwise no…
| Parameter | Type | Description |
|---|---|---|
url * | string | The x402 resource: an https URL on a public host. |
body | string | Request body, e.g. JSON (at most 64 KiB; Content-Type defaults to "application/json"). Not with GET. |
context | string | The content that led you to pay (the instruction, page text or tool output), verbatim. Treated as untrusted and scanned for injected instructions. |
headers | object | Extra request headers (at most 20), e.g. Accept. Payment headers are set by this server and cannot be passed. |
max_usd | number | The most you will pay for this resource, in USD. It can only lower the operator's per-payment cap. |
method | string | HTTP method. Default GET. |
x402check_verify_attestation x402check: verify an attestation
Verify an x402check attestation (the compact JWS from a check result) before relying on it: ES256 signature with the key from the issuer's did:web document (never a key or URL carried by the token or a response), pinned attestation keys, issuer, expiry, and optionally audience, subject (EVM compared case-insensitively, base58 case-sensitively), the exact request it answers (`request`, which binds request_hash) and a maximum age. Pass `request` whenever you know what was checked: without it, a verdict issued for another payment can still verify. An invalid attestation must not be relied on. Fre…
| Parameter | Type | Description |
|---|---|---|
jws * | string | The attestation: the compact JWS from a check result's `jws`. |
aud | string | Require this audience. |
max_age_seconds | integer | Refuse a verdict issued longer ago than this, plus 300 s of clock-skew allowance (attestations are otherwise valid for an hour). |
request | object | The exact request that was checked (the body sent to x402check). Binds the verdict to it: one issued for any other request (another payee, amount, chain, site or context) fails with request_mismatch. |
sub | string | Require this subject (the counterparty address you are about to pay or approve). |
x402check_methodology x402check: methodology and limits
What x402check checks, where the data comes from, its price, and its published, measured limits (what a clean verdict does NOT mean). Read it before explaining a verdict to a user.