x402 spend preflight
x402_preflightGive it the x402 endpoints your agent is about to call and your spending rules (per-request cap, total budget, allowed networks). It probes every endpoint without paying, in parallel, and returns which ones are safe to pay, the real price in USD, network and pay-to address of each, the total cost, and a plain reason for every endpoint it blocks (over the cap, over budget, testnet only, not a valid x402 endpoint, non-USD price). Use it as a guardrail step in any agent that spends money. Paid tool: $0.005 per call in USDC via x402 at POST https://x402-tools.com/v1/x402-preflight. Calling it here returns the endpoint, price and how to pay.
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": {
"urls": "<urls>"
},
"name": "x402_preflight"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | 1 to 10 x402 endpoint URLs, or objects { url, method } to probe with POST. | |
| networks | No | Allowed networks, e.g. ["base"] or ["eip155:8453"]. Default: any mainnet. | |
| budget_usd | No | Total budget in USD for this batch. Endpoints are approved in order until it runs out. | |
| max_price_usd | No | Per-request cap in USD. Endpoints that cost more are blocked. |