Skip to main content
Glama

Check an x402 payment before paying

check_payment
Read-onlyIdempotent

Decide 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

NameRequiredDescriptionDefault
urlYesFull URL of the x402 endpoint you are about to pay, including path
assetNoToken (asset) address from the quote. Send it: a quote asking for a different token than this endpoint charges is denied (asset swap).
payToNoWallet address from the endpoint's 402 quote
amountNoAmount about to be paid, atomic units (USDC has 6 decimals: 10000 = $0.01)
networkNoNetwork from the quote, e.g. eip155:8453. Send it: a quote on a network this endpoint never uses is denied.
hasAccessNotrue 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).
maxAmountNoYour hard cap for this payment in atomic units (USDC: 1000000 = $1). Payments above it are denied.
allowCautionNofalse = deny endpoints with a caution verdict too, not just avoid (default true)
allowLookalikeNotrue = don't ask for review when the endpoint is flagged as a possible lookalike of an established seller (default false)
priceToleranceNoOptional, 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.
minOrganicShareNoOptional, 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.
requireVerifiedNotrue = only allow endpoints that delivered on a real test payment (default false)
pauseDuringRetestNotrue = 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

NameRequiredDescriptionDefault
urlNo
allowYesPay only when true
gradeNo
notesNo
scoreNo
buyersNoWho is really behind the seller's buyers. Never changes the grade.
intakeNoFor 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
retestNoPresent 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
valuesNoAutomatic value checks on the latest paid response
listingNoPresent only when the latest paid response differs from the listing's example or schema. The data is delivered.
reasonsYesWhy it was allowed or denied
verdictNoproceed | caution | avoid | free | insufficient_data
deliveryNo
forTeamsNoShort note about team plans (per-agent keys, spend limits, audit trail)
observedNoThe latest payment quote our monitor saw
lookalikeNoPresent 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.
monitoredYesWhether the endpoint is in the monitored catalog
payToModeNo
reviewableNoDenied only for reasons a person may approve
afterPayingNoHow to report the outcome after paying (free, verified on-chain)
authRequiredNotrue: the seller needs its own sign-in on top of x402; send hasAccess: true if you have it
buyerReportsNoWhat real buyers reported after paying. Never changes the grade; confirmations move the endpoint up our paid-test queue.
gradeReasonsNoEvery factor behind the endpoint's grade (same as check_endpoint's reasons)
declaredPayToNoPayout wallets the seller declared itself
gradeHeadlineNoWhy the endpoint has its grade, in one sentence
walletUnconfirmedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / pauseDuringRetest
      Added value: +{
      +  "description": "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)",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / intake
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "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",
      +  "properties": {
      +    "note": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "queued | checking | monitored | rejected_recently | host_full | busy | invalid",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "note"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / retest
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "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",
      +  "properties": {
      +    "firstFailureAt": {
      +      "type": "string"
      +    },
      +    "moneyTaken": {
      +      "type": "boolean"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "pending": {
      +      "type": "boolean"
      +    },
      +    "reason": {
      +      "type": "string"
      +    },
      +    "retestDueBy": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "pending",
      +    "firstFailureAt",
      +    "retestDueBy",
      +    "moneyTaken",
      +    "reason",
      +    "note"
      +  ],
      +  "type": "object"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / allowLookalike
      Added value: +{
      +  "description": "true = don't ask for review when the endpoint is flagged as a possible lookalike of an established seller (default false)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / asset
      Added value: +{
      +  "description": "Token (asset) address from the quote. Send it: a quote asking for a different token than this endpoint charges is denied (asset swap).",
      +  "type": "string"
      +}
    • changedInput schema / properties / network / description
      Previous value: -"Network from the quote, e.g. eip155:8453"New value: +"Network from the quote, e.g. eip155:8453. Send it: a quote on a network this endpoint never uses is denied."
    • addedOutput schema / properties / lookalike
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "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.",
      +  "properties": {
      +    "of": {
      +      "type": "string"
      +    },
      +    "reason": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "of",
      +    "reason"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / properties / observed / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "amount": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "network": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "payTo": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "seenAt": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "amount": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "assets": {
      +        "description": "Tokens this endpoint has been seen quoting",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "network": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "payTo": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "seenAt": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed1 schema field changed
    • addedInput schema / properties / priceTolerance
      Added value: +{
      +  "description": "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.",
      +  "maximum": 0.5,
      +  "minimum": 0,
      +  "type": "number"
      +}
  4. Changed2 schema fields changed
    • addedOutput schema / properties / gradeHeadline
      Added value: +{
      +  "description": "Why the endpoint has its grade, in one sentence",
      +  "type": "string"
      +}
    • addedOutput schema / properties / gradeReasons
      Added value: +{
      +  "description": "Every factor behind the endpoint's grade (same as check_endpoint's reasons)",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "at": {
      +        "description": "Date of the event it's based on (YYYY-MM-DD)",
      +        "type": "string"
      +      },
      +      "effect": {
      +        "description": "positive, neutral or negative",
      +        "type": "string"
      +      },
      +      "factor": {
      +        "description": "data, delivery, uptime, speed, wallet, price, listing, values, access or withdrawn",
      +        "type": "string"
      +      },
      +      "limit": {
      +        "description": "The ceiling this factor puts on the grade, e.g. \"F (max 39)\"",
      +        "type": "string"
      +      },
      +      "text": {
      +        "description": "What we found, in plain words (paid-test results include the date and what came back)",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "factor",
      +      "effect",
      +      "text"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  5. Changed2 schema fields changed
    • addedInput schema / properties / hasAccess
      Added value: +{
      +  "description": "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).",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / authRequired
      Added value: +{
      +  "description": "true: the seller needs its own sign-in on top of x402; send hasAccess: true if you have it",
      +  "type": "boolean"
      +}
  6. Changed3 schema fields changed
    • addedOutput schema / properties / afterPaying
      Added value: +{
      +  "description": "How to report the outcome after paying (free, verified on-chain)",
      +  "type": "string"
      +}
    • addedOutput schema / properties / buyerReports
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "What real buyers reported after paying. Never changes the grade; confirmations move the endpoint up our paid-test queue.",
      +  "properties": {
      +    "confirmed": {
      +      "description": "Buyers (customers or wallets) who reported a usable response in 7 days",
      +      "type": "number"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "ourTestQueued": {
      +      "description": "Our own paid test is queued for this endpoint",
      +      "type": "boolean"
      +    },
      +    "problems": {
      +      "description": "Buyers who reported a problem in 7 days",
      +      "type": "number"
      +    },
      +    "windowDays": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "confirmed",
      +    "problems",
      +    "ourTestQueued",
      +    "windowDays",
      +    "note"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / values
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Automatic value checks on the latest paid response",
      +  "properties": {
      +    "checked": {
      +      "type": "boolean"
      +    },
      +    "warning": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "checked"
      +  ],
      +  "type": "object"
      +}
  7. Changed3 schema fields changed
    • changedOutput schema / properties / listing / description
      Previous value: -"Present only when the latest paid response doesn't match the listing's example. The data is delivered; the grade is capped at B until the listing matches."New value: +"Present only when the latest paid response differs from the listing's example or schema. The data is delivered."
    • addedOutput schema / properties / listing / properties / capped
      Added value: +{
      +  "description": "true: the data is reshaped vs the listing (nested, list vs item), grade capped at B; false: a minor gap, warning only",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / listing / properties / sellerFix / description
      Previous value: -"What the seller changes to lift the B cap"New value: +"What the seller can change"
  8. Changed1 schema field changed
    • addedOutput schema / properties / listing
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Present only when the latest paid response doesn't match the listing's example. The data is delivered; the grade is capped at B until the listing matches.",
      +  "properties": {
      +    "matchesExample": {
      +      "description": "false: the paid response differs from the seller's own example",
      +      "type": "boolean"
      +    },
      +    "sellerFix": {
      +      "description": "What the seller changes to lift the B cap",
      +      "type": "string"
      +    },
      +    "warning": {
      +      "description": "How the real response differs, and where to read the fields",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "matchesExample",
      +    "warning",
      +    "sellerFix"
      +  ],
      +  "type": "object"
      +}
  9. Changed2 schema fields changed
    • addedInput schema / properties / minOrganicShare
      Added value: +{
      +  "description": "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.",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedOutput schema / properties / buyers
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Who is really behind the seller's buyers. Never changes the grade.",
      +  "properties": {
      +    "buyerWallets30d": {
      +      "description": "Buyer wallets that paid the seller in 30 days",
      +      "type": "number"
      +    },
      +    "estimated": {
      +      "description": "true when counted from a sample of buyers",
      +      "type": "boolean"
      +    },
      +    "flags": {
      +      "description": "coordinated_wallets, self_funded, concentrated_buyers, shared_operator, estimated, partial_lookup",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "independentBuyers30d": {
      +      "description": "Independent buyers behind the seller's buyer wallets in 30 days (wallets funded from one source count as one)",
      +      "type": "number"
      +    },
      +    "organicShare": {
      +      "description": "0-1: share of 30-day volume from independent buyers",
      +      "type": "number"
      +    },
      +    "reviewed": {
      +      "description": "false until the seller's buyers have been reviewed (the biggest sellers are reviewed daily)",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "reviewed"
      +  ],
      +  "type": "object"
      +}
  10. First observed

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description still adds real behavioral context beyond them: it is free, it 'doesn't make or block the payment itself,' it returns a reasons list on denial, and pauseDuringRetest can hold payments pending a re-test. It stops short of describing latency or how the trust verdict is sourced, so it is strong but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The decision and its inputs are front-loaded, and the sentence sequence moves from what it does to when to use it to what it does not do. There is mild redundancy: 'returns allow true/false with reasons' is restated later as 'When allow is false, the reasons list explains why,' and the docs URL plus pauseDuringRetest detail add tail weight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 13 parameters and an output schema, the description covers the decision logic, the pass/fail contract, the optional rule switches, and the boundary that this tool does not execute or block payment. Nothing an agent needs in order to invoke it correctly or interpret 'allow' is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and each parameter already carries a detailed description, including the same examples (asset swap, network mismatch, atomic-unit amounts) that the prose references. The description adds the useful aggregate rule that 'allow is true only when every rule passes,' but most parameter meaning is already in the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and decision object ('Decide whether a specific x402 payment should go through'), states the return contract ('returns allow true/false with reasons'), and enumerates the concrete rules checked (trust verdict, cap, monitored price, payTo match, organic share). It also distinguishes itself from the sibling check_endpoint, which handles the no-quote case.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names the exact moment of use ('right before a payment') and the required inputs sourced from the endpoint's 402 quote (amount, payTo, network). It explicitly routes the agent elsewhere when no quote is in hand: 'Use check_endpoint instead if you only want an endpoint's grade.' Both the when and the alternative are stated, not implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.