decode_402
Parse and validate an x402 PaymentRequired (HTTP 402) response, explain each field, and flag missing scheme, network, asset, payTo, amount, or decimals to fix invalid payment requirements.
Instructions
Parse and validate an x402 PaymentRequired (HTTP 402) response and explain every field. Flags missing economic fields (scheme/network/asset/payTo/amount), number-typed or human-decimal amounts (must be atomic-integer strings), and missing explicit decimals. Provide ONE of: url (does an unpaid GET and decodes the 402), raw (a JSON or base64-encoded-JSON body string), or json (an object). Deterministic; the only network is the optional unpaid GET.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "decode_402"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | A PaymentRequired as a JSON string or base64-encoded JSON. | |
| url | No | Resource URL to GET unpaid; expects a 402 with a PaymentRequired body. | |
| json | No | A PaymentRequired as an object. |