Skip to main content
Glama

Check an x402 payment before paying

check_payment
Read-onlyIdempotent

Decide whether an x402 payment should proceed before paying: verify endpoint trust, amount caps, wallet match, and optional organic share, returning allow with reasons.

Instructions

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. API docs: https://github.com/Book0fEli/lumiere-paycheck/blob/main/docs/api.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesFull URL of the x402 endpoint you are about to pay, including path
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
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)
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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, idempotentHint and destructiveHint=false, but the description adds real behavioral context: it is free, it neither executes nor blocks the payment, allow is true only when every rule passes, and false results come with a reasons list. It does not describe latency, caching, or failure modes when the endpoint is unknown, so it is short of a 5.

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?

Front-loaded with the decision and its return semantics, then the rule set, then exclusions and limitations. It is on the longer side with a docs URL appended, but nearly every sentence carries information the agent needs and there is no filler.

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?

There is no output schema, and the description compensates by describing the return contract (allow boolean plus reasons list) and the semantics of a false verdict. Combined with the rule enumeration and defaults noted in the schema, an agent has everything needed to call and interpret this tool correctly.

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

Parameters4/5

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

Schema description coverage is 100%, so the parameters are already documented and the baseline is 3. The description goes modestly beyond by explaining how the inputs combine into a decision (trust verdict, amount within cap and not above monitored price, payTo matching the observed wallet, optional minOrganicShare gate) and by naming the 402-quote provenance for url/payTo/amount/network.

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?

States a specific decision verb and resource ('Decide whether a specific x402 payment should go through') and immediately describes the output shape (allow true/false with reasons). It explicitly distinguishes itself from the sibling check_endpoint by noting that this one is for when a 402 quote is in hand. An agent can pick it without opening the schema.

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?

Gives explicit timing ('Intended for right before a payment, with the amount, payTo, and network from the endpoint's 402 quote') and an explicit alternative with the selecting condition ('Use check_endpoint instead if you only want an endpoint's grade without a quote in hand'). It also clarifies the tool does not itself make or block the payment, removing a likely agent misconception.

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