Skip to main content
Glama

x402 precheck

x402_precheck
Read-only

Check an x402 payment challenge BEFORE your agent pays (0.002 USDC per check via x402; free trial 1024 checks/IP/UTC day). Give an endpoint URL (fetched unpaid, never paid) or paste a 402 challenge. Validates x402 version, scheme, network (CAIP-2, testnet flag), canonical USDC asset, amount sanity, payTo format/EIP-55 checksum/zero address, EIP-712 domain, payment window, facilitator reachability and scheme/network support, optional maxPriceUsd / expectPayTo / expectNetwork policy, and PayAI Bazaar listing match. Returns per-check pass/warn/fail and a verdict: looks_ok, review or do_not_pay. Informational; invalid input and failed checks are not charged.

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": "x402_precheck"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNox402 endpoint URL to probe (public http/https). Fetched unpaid; never paid.
methodNoHTTP method used to probe urlGET
challengeNoAlternative to url: the 402 challenge itself (JSON body, or the base64 PAYMENT-REQUIRED header value). Takes precedence over url.
expectPayToNoPolicy: fail options whose payTo differs from this address
facilitatorNoFacilitator base URL to test (https). Default: PayAI (mainnet) / x402.org (testnet).
maxPriceUsdNoPolicy: fail options priced above this many USD (USDC)
expectNetworkNoPolicy: fail options not on this network (CAIP-2, e.g. eip155:8453)
compareDirectoryNoCompare live terms with the PayAI Bazaar listing (url mode)true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Goes well past the readOnlyHint/openWorldHint annotations by disclosing the pricing model (0.002 USDC per check, 1024 free checks/IP/day), that the URL is fetched unpaid and never paid, that invalid input and failed checks are not charged, and what the verdict values mean. The description could still say more about latency or facilitator timeout behavior, but the behavioral surface is largely covered.

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 core purpose and risk framing, then cost, then inputs, then validations, then outputs — a sensible order with no filler. It is dense and clause-heavy (one very long sentence spans the whole check list), which slightly hurts scannability.

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 8 optional parameters and no output schema, the description compensates by enumerating every validation performed and defining the return structure ('per-check pass/warn/fail and a verdict: looks_ok, review or do_not_pay'). Combined with the pricing and non-charging rules, an agent has everything needed to call and interpret it.

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%, so the baseline is 3. The description does group maxPriceUsd, expectPayTo and expectNetwork as 'policy' checks and reinforces the PayAI Bazaar comparison, but it adds little syntax or meaning beyond what the schema already states (defaults, formats, precedence).

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 verb and resource ('Check an x402 payment challenge') plus the exact scope of what is validated and the three possible verdicts. An agent immediately knows this is a pre-payment validator rather than a payment executor, and the tool has no siblings to be confused with.

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?

The description makes the usage condition explicit upfront ('BEFORE your agent pays') and explains the two input modes (endpoint URL vs. pasted 402 challenge), including cost and the free-trial quota. It stops short of naming when-not-to-use or alternative tools, but no alternatives exist in the catalog.

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.

Resources