Skip to main content
Glama

check_x402_payment

Validate an x402 payment requirement before signing. Return approve, hold, or reject while blocking OFAC-listed recipients and unsupported assets.

Instructions

Check an x402 payment requirement BEFORE signing it.

Pass the fields from the 402 response's chosen payment requirement: network (CAIP-2 such as
"eip155:8453", or a legacy name such as "base-sepolia"), asset (token contract address),
amount (in the token's smallest unit, as a string) and pay_to (recipient). payer is the
agent's own wallet address. Pass the requirement's description and extra fields (or the whole
402 response body) as untrusted_text: self-asserted claims such as "verified offline" are held.

Payments to or from addresses on the OFAC SDN list (bundled, dated snapshot) are rejected.
Only USDC on Ethereum, Base and Base Sepolia is checked; anything else is rejected.
Only sign and pay if decision is "approve".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYesToken contract address from the payment requirement. Only USDC is accepted.
payerYesYour own (the paying agent's) wallet address.
amountYesAmount in the token's smallest unit, as a string (USDC has 6 decimals, so "1000000" is 1 USDC).
pay_toYesRecipient address (payTo) from the payment requirement.
networkYesNetwork from the x402 payment requirement, CAIP-2 such as "eip155:8453" or a name such as "base-sepolia".
untrusted_textNoOptional. The payment request's own text exactly as received: memo, invoice, description, x402 extra fields or the whole request. Never your own verification results.
peg_deviation_pctNoOptional. USDC's deviation from $1.00 in percent from your own price feed, for example -0.3. Omit if unknown; the depeg check is then skipped and reported.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.3.1
    • addedInput schema / properties / amount / description
      Added value: +"Amount in the token's smallest unit, as a string (USDC has 6 decimals, so \"1000000\" is 1 USDC)."
    • addedInput schema / properties / asset / description
      Added value: +"Token contract address from the payment requirement. Only USDC is accepted."
    • addedInput schema / properties / network / description
      Added value: +"Network from the x402 payment requirement, CAIP-2 such as \"eip155:8453\" or a name such as \"base-sepolia\"."
    • addedInput schema / properties / pay_to / description
      Added value: +"Recipient address (payTo) from the payment requirement."
    • addedInput schema / properties / payer / description
      Added value: +"Your own (the paying agent's) wallet address."
    • addedInput schema / properties / peg_deviation_pct / description
      Added value: +"Optional. USDC's deviation from $1.00 in percent from your own price feed, for example -0.3. Omit if unknown; the depeg check is then skipped and reported."
    • addedInput schema / properties / untrusted_text / description
      Added value: +"Optional. The payment request's own text exactly as received: memo, invoice, description, x402 extra fields or the whole request. Never your own verification results."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does so well: OFAC SDN rejection against a bundled dated snapshot, hard rejection of anything that is not USDC on the three named chains, and the note that self-asserted claims are 'held'. It does not describe rate limits, latency, or failure behavior on malformed input.

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-loads the imperative and decision rule, then groups the field mapping in one dense paragraph. Every sentence carries information, though the field enumeration overlaps with what the schema already states.

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

Completeness4/5

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

An output schema exists, so the description needn't explain return shape, and it correctly only references 'decision is "approve"'. Scope limits, untrusted-text handling, and the optional depeg check are all covered; nothing an agent needs to call this safely 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 description coverage is 100% and the schema already documents every field, including the 6-decimal USDC example and 'Never your own verification results'. The description restates the same semantics (CAIP-2 formats, smallest-unit string, payer is your own wallet) with little that is not 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.

Purpose4/5

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

States a specific verb and resource ('Check an x402 payment requirement') and pins the timing ('BEFORE signing it'), which is the agent's key decision point. It also declares scope (USDC on Ethereum, Base, Base Sepolia) and rejection rules, but never names or distinguishes itself from siblings like check_payment_rules or check_address_sanctions.

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

Usage Guidelines4/5

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

Gives a clear operative rule ('Only sign and pay if decision is "approve"') plus precondition timing ('BEFORE signing it') and per-parameter guidance ('Omit if unknown; the depeg check is then skipped and reported'). It stops short of explicitly routing the agent away from the sibling checking tools.

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