Knock on an endpoint, with your own payment
knock_on_endpointKNOCK ON AN x402 ENDPOINT AND GET WHAT IT SERVED. test_purchase beside this walks a buy WITHOUT paying and stops at the quote; its own caveat has always said that only paying and reading the answer establishes what arrives, “which is the half that needs your own wallet”. This is that half, and it is the same capability the web and the plugin have. WITHOUT payment it reads the terms: accepts carries EVERY set of terms the seller published and signable the ones an EIP-3009 wallet can meet, and WHICH ONE TO PAY ON IS YOURS TO CHOOSE. WITH payment we forward the authorisation YOU signed and hand back what the seller served. WE NEVER HOLD YOUR KEY. A SERVED ANSWER MEANS THE SELLER ACCEPTED IT, NOT THAT MONEY SETTLED. A 402 on a knock that CARRIED a payment is reported as rejected, not as a fresh quote, and IT DOES NOT ESTABLISH THAT NOTHING WAS SPENT. settlementState and authorizationState are the fields to read: a presented authorisation stays usable until it expires or its nonce is spent, so signing again with a fresh nonce can be a SECOND payment. We knock only on endpoints already in the x402 catalogue we read, at most one UNPAID handshake a minute per endpoint shared by everybody, and never on our own host: what we sell has one set of terms and one door. The seller’s answer is yours and is not stored. FREE.
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": {
"resource": "<resource>"
},
"name": "knock_on_endpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | Values for slots the SELLER’s own catalogue URL declares, e.g. `{"doi": "10.1000/xyz"}`. Only declared slots are accepted; a name the template does not contain is REFUSED rather than ignored. Values are percent-encoded and the filled URL is verified to reach the same origin and path shape as the catalogue entry, so a value can never choose the host. | |
| send | No | A JSON body, for the many x402 endpoints that take POST rather than GET. | |
| asset | No | The token contract the payment authorisation is against (the offer’s `asset`). With it, the token’s own `authorizationState(from, nonce)` is read BEFORE the authorisation is handed over, and an already-used one is refused as a replay (409 `authorization_already_used`). The same read is made after the seller answers whether or not this is sent, from the offer when the seller published one. | |
| query | No | Query parameters to add to the catalogue address, e.g. `{"txid": "4a5e…"}` for an endpoint whose 402 document declares `?txid=`. `inputs` on the unpaid answer names what the SELLER declares; a seller may need one it does not declare, so undeclared names are accepted too. The origin and path stay the catalogue’s and are verified unchanged, a parameter already in the catalogue address is never replaced, values are bounded and refused rather than trimmed, at most ten. Send the SAME values with the paid knock: paying for a call without its input usually buys an error. | |
| payment | No | A finished x402 `exact` payment, base64, as YOUR wallet produced it. Sent to the seller under both `X-PAYMENT` and `PAYMENT-SIGNATURE`, because v1 and v2 sellers read different names. A v2 seller matches on the `accepted` field, which must echo the entry of `accepts` you chose VERBATIM — omit it and the answer is “No matching payment requirements”, which reads like a refusal and is an envelope fault. Omit `payment` entirely to read the terms first. WE NEVER HOLD YOUR KEY and this path cannot: it takes a finished authorisation and carries it, because a seller’s host sends no CORS headers and that failure is indistinguishable from the endpoint being down. | |
| describe | No | True to include `blocks`, the answer read as a person reads it: tiles, tables, pairs and charts where the shape allows one. Always read as a STRANGER’s payload — no unit is added, no tone inferred, and nothing drawn that would claim their numbers are parts of one whole. | |
| resource | Yes | The http(s) endpoint to knock on. It must be one the x402 catalogue already holds; `list_x402_endpoints` finds it. A URL with no scheme is accepted and resolved against the catalogue, so `example.com/api/x` works. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | What was served, parsed, where it was JSON and whole. Theirs, not ours, and not stored by us. | |
| meta | No | How current this answer is and what it was read from: `freshness` and the ages behind it. Present on every answer from this server, whatever the tool. | |
| paid | No | Whether an authorisation travelled with this knock. Stated rather than left to be inferred from the outcome. | |
| says | Yes | What happened, in one sentence. On a `rejected` knock it says the seller refused the authorisation AND that the HTTP answer does not establish on-chain settlement either way; where `authorizationOnChain` was read, its sentence is appended. | |
| text | No | What was served as text, where it was not JSON or was cut short at 512 KB. | |
| fault | No | `not-evm`, `not-exact`, `no-token-domain` and the rest: why none of the offered terms can be signed. `not-evm` is a real offer on a chain an EVM wallet cannot sign for, which differs from a malformed one. | |
| offer | No | The first signable leg, which is the SELLER’s preference and not a recommendation of ours. Null where none of the terms can be met. | |
| blocks | No | Present only with `describe: true`. | |
| inputs | No | WHAT THE SELLER SAYS THE CALL TAKES, from their own 402 document (bazaar `info.input` and its schema in v2, `outputSchema.input` in v1): `method`, and `query` / `body` as `{ name, required, description, example }`. `required` is true only where they say so. NULL WHERE THEY DECLARE NOTHING, which is not “it needs nothing”: some sellers need a value they never declare. Theirs and a claim. | |
| accepts | No | EVERY set of terms the seller offered, unchanged, including the ones no browser or EIP-3009 wallet can meet. | |
| knocked | Yes | False where the resource is not in the catalogue we read, which is OUR reach rather than a fault of theirs. Everything below is then absent. | |
| outcome | No | `served` is an answer in hand. `quoting` is 402 with terms we could read and `charging` 402 without. `rejected` is 402 on a knock that CARRIED a payment, which is the seller refusing what you signed and a different fact from the first 402. `refused` is 401 or 403, where payment is not what is being asked for. On `rejected`, `sellerSays` carries their reason in their words, and the answer DOES NOT ESTABLISH THAT NOTHING WAS SPENT: the seller held your authorisation before answering, and a status code does not report what they did with it. | |
| offering | No | What the SELLER says this endpoint is and returns: `name`, `description` and `example`, a specimen answer from their own bazaar extension. Theirs and a claim, not a promise of ours. | |
| resource | Yes | The endpoint, as the CATALOGUE holds it, read back. A scheme you left off is resolved here. | |
| signable | No | The legs an `exact` EVM wallet can sign, in the seller’s own order, each flattened to what signing needs. `amountRaw` is a STRING in the asset’s smallest unit; `approxUsd` is present ONLY where the seller’s own catalogue entry publishes both figures for the SAME token, since nothing in a payment-requirements document names a token’s decimals. `terms` is their entry VERBATIM, to echo back as `accepted`. A real offer has several (agent402.tools publishes nine), and WHICH ONE TO PAY ON IS YOURS TO CHOOSE because the chain is inside the signed message and a signature made on a chain you hold nothing on is valid and fails at the transfer. | |
| warnings | No | Anything the server wants a caller to know about THIS answer before acting on it. Empty is the normal case and is not a guarantee. | |
| faultSays | No | The same thing in a sentence. | |
| latencyMs | No | How long it took US, which is a fact about this request as much as about the host. | |
| truncated | No | TRUE where the answer was cut at 512 KB, and then `json` is null EVEN IF the cut happens to parse: half a list read as a whole one is a figure nobody could stand behind. | |
| httpStatus | No | What the host answered, unchanged. | |
| sellerSays | No | Why the seller refused, IN THEIR WORDS, lifted from their 402 document. Null where they gave none, which is said rather than filled in. | |
| settlement | No | The seller’s settlement receipt, verbatim. THEIR claim that the authorisation reached a chain, carried as theirs and never restated as a reading of ours. A served answer means the seller accepted the authorisation, not that money settled: somebody still has to submit it on chain, and this is the seller saying so rather than us. | |
| askedWithQuery | No | The query parameters we added, read back. Null where you sent none. | |
| settlementState | No | WHAT THIS ANSWER ESTABLISHES ABOUT THE MONEY, which is less than the status code suggests. `none-presented`: no authorisation was handed over, so there is nothing that could settle. `claimed-by-seller`: they returned a receipt — THEIR claim, carried, never verified by us. `unknown`: an authorisation WAS presented and this answer says nothing about its fate. A 402 or a timeout after a payment reads `unknown`: it does NOT establish that the money is safe. | |
| authorizationState | No | WHAT MAY STILL BE DONE WITH WHAT THE CALLER SIGNED. `none-signed`: nothing was signed, so nothing can be submitted. `presented-may-still-be-usable`: it was handed over and a valid authorisation stays usable until it expires or its nonce is spent — so signing again with a fresh nonce can be a SECOND payment. Check the previous transaction before you do. | |
| authorizationOnChain | No | The independent check (2026-11-04): the token contract’s own `authorizationState(from, nonce)` after the seller answered. `state` is `used` (the transfer happened on chain, whatever the seller said), `unused` (no money had moved at `block`; `usableUntil` says until when whoever holds it can still submit it, `expired` whether that has passed) or `not-checked` (the chain or token could not be read; nothing is then said about the money). Null on an unpaid knock. |