Offline buyer payment-policy consistency check
x402.policy_checkDecode a caller-supplied merchant PAYMENT-REQUIRED header and evaluate each accepts[] option against an explicit buyer policy (networks, pay_to, assets, max atomic amount). Does not fetch merchant URLs or settle the inspected purchase. Unpaid → PaymentRequired for this server's analysis fee; pay via _meta['x402/payment']. Pass policy as a JSON object string.
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": {
"payment_required_header": "<payment_required_header>",
"policy": "<policy>"
},
"name": "x402.policy_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy | Yes | Buyer policy JSON object as a string. Example: {"allowed_networks":["eip155:84532"],"max_amount_atomic":"10000000"} | |
| agent_id | No | Optional agent identity for quota accounting. | |
| request_digest | No | Optional JSON string with canonical_url, http_method, body_sha256. | |
| idempotency_key | No | Optional idempotency key (max 128 chars). | |
| payment_required_header | Yes | Inspected merchant PAYMENT-REQUIRED header value (base64 wire from HTTP 402). |