Check an x402 payment before paying
check_paymentDecide whether a specific x402 payment should go through: returns allow true/false with reasons. Checks the endpoint's trust verdict, that the amount is within your cap and not above the monitored price, and that the payTo wallet matches the one we've observed (catches swapped or hijacked wallets). Optionally (minOrganicShare) it also requires that enough of the seller's volume comes from independent buyers. Intended for right before a payment, with the amount, payTo, and network from the endpoint's 402 quote; allow is true only when every rule passes. Use check_endpoint instead if you only want an endpoint's grade without a quote in hand. Read-only and free; it doesn't make or block the payment itself. When allow is false, the reasons list explains why. pauseDuringRetest: true also holds payments while a failed paid test awaits its re-test. API docs: https://github.com/Book0fEli/lumiere-paycheck/blob/main/docs/api.md
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>"
},
"name": "check_payment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full URL of the x402 endpoint you are about to pay, including path | |
| asset | No | Token (asset) address from the quote. Send it: a quote asking for a different token than this endpoint charges is denied (asset swap). | |
| payTo | No | Wallet address from the endpoint's 402 quote | |
| amount | No | Amount about to be paid, atomic units (USDC has 6 decimals: 10000 = $0.01) | |
| network | No | Network from the quote, e.g. eip155:8453. Send it: a quote on a network this endpoint never uses is denied. | |
| hasAccess | No | true if you have your own account, API key or sign-in with this seller. For endpoints that need the seller's sign-in on top of x402, allowCaution/requireVerified then don't block (we couldn't confirm delivery only because we can't sign in). | |
| maxAmount | No | Your hard cap for this payment in atomic units (USDC: 1000000 = $1). Payments above it are denied. | |
| allowCaution | No | false = deny endpoints with a caution verdict too, not just avoid (default true) | |
| allowLookalike | No | true = don't ask for review when the endpoint is flagged as a possible lookalike of an established seller (default false) | |
| priceTolerance | No | Optional, 0-0.5 (default 0.02 = 2%): how far above the endpoint's recent prices still counts as the same price, for sellers whose price drifts (pegged to BTC, gas or FX). Bigger jumps are denied as overcharges. | |
| minOrganicShare | No | Optional, 0-1: deny sellers where less than this share of 30-day volume comes from independent buyers (e.g. 0.5). Not applied to sellers whose buyers haven't been reviewed yet. | |
| requireVerified | No | true = only allow endpoints that delivered on a real test payment (default false) | |
| pauseDuringRetest | No | true = deny while our latest paid test of this endpoint failed and its re-test (about 2 hours later) hasn't run yet (default false: allowed, with a note and a retest field) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| allow | Yes | Pay only when true | |
| grade | No | ||
| notes | No | ||
| score | No | ||
| buyers | No | Who is really behind the seller's buyers. Never changes the grade. | |
| intake | No | For an endpoint we don't monitor yet: it's put in line for a first check, and joins the catalog within about 10 minutes if it answers a valid x402 payment quote | |
| retest | No | Present while our latest paid test failed and its re-test (about 2 hours later) hasn't run: the grade still shows the earlier result and changes only if the re-test fails too | |
| values | No | Automatic value checks on the latest paid response | |
| listing | No | Present only when the latest paid response differs from the listing's example or schema. The data is delivered. | |
| reasons | Yes | Why it was allowed or denied | |
| verdict | No | proceed | caution | avoid | free | insufficient_data | |
| delivery | No | ||
| forTeams | No | Short note about team plans (per-agent keys, spend limits, audit trail) | |
| observed | No | The latest payment quote our monitor saw | |
| lookalike | No | Present when this new endpoint looks like an imitation of an established seller (name one character off, lookalike characters, or a copied listing) and pays a different wallet. check_payment asks for review unless allowLookalike is true. | |
| monitored | Yes | Whether the endpoint is in the monitored catalog | |
| payToMode | No | ||
| reviewable | No | Denied only for reasons a person may approve | |
| afterPaying | No | How to report the outcome after paying (free, verified on-chain) | |
| authRequired | No | true: the seller needs its own sign-in on top of x402; send hasAccess: true if you have it | |
| buyerReports | No | What real buyers reported after paying. Never changes the grade; confirmations move the endpoint up our paid-test queue. | |
| gradeReasons | No | Every factor behind the endpoint's grade (same as check_endpoint's reasons) | |
| declaredPayTo | No | Payout wallets the seller declared itself | |
| gradeHeadline | No | Why the endpoint has its grade, in one sentence | |
| walletUnconfirmed | No |