Skip to main content
Glama

Base Agent Due-Diligence Kit

x402 Preflight: check an x402 endpoint before paying it ($0.005)

x402_preflight
Read-onlyIdempotent

Check an x402 endpoint before paying it: decodes the 402 challenge (v1 or v2), verifies the asset is canonical USDC, converts price to USD, checks payTo (EOA vs contract on Base), EIP-712 domain, discovery metadata and spec compliance. Returns verdict ok/caution/do_not_pay and the cheapest safe option. PAID: $0.005 per call in USDC on Base via x402, or use a 0.25 USDC transfer pass (pay_tx). See payment_options. By Bolt.

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

Input Schema

NameRequiredDescriptionDefault
urlYesFull URL of the x402 endpoint to check
methodNoHTTP method used to trigger the 402 (default GET)
pay_txNoOptional, for the plain-transfer option (no x402 needed): hash of a USDC transfer of >= 0.25 USDC to this server's receiving address (get it from the payment_options tool). One transfer unlocks every paid tool for 24h.
max_usdNoOptional budget per call; options above it fail
pay_chainNoChain of pay_tx (default: inferred; 0x hash = base, base58 signature = solana)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, open-world, non-destructive behavior, and the description layers on the things annotations can't express: the $0.005 price, USDC-on-Base payment mechanics, the 0.25 USDC transfer pass unlocking all paid tools for 24h, and the ok/caution/do_not_pay verdict vocabulary. Cost, auth path, and outcome shape are all disclosed.

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 purpose and action list come first and the payment/pricing note follows, which is the right ordering for an agent deciding whether to call. It is dense but almost every clause carries information; the only minor waste is the partial restatement of the title's 'before paying it'.

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?

For a read-only checker with no output schema, the description supplies the return verdicts and the 'cheapest safe option' payload, plus the payment prerequisite. It does not explain what a caution verdict implies or what spec-compliance failures look like, leaving a small gap for an agent interpreting results.

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%, so every parameter including pay_tx and pay_chain is already described in the schema, and the description adds little per-parameter meaning beyond restating that max_usd caps options and pay_tx follows the plain-transfer route. Baseline 3 applies when the schema does the heavy lifting.

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?

Names a specific verb and resource ('Check an x402 endpoint before paying it') and then enumerates the concrete validations: 402 challenge decode (v1/v2), canonical USDC check, price-to-USD conversion, payTo EOA vs contract on Base, EIP-712 domain, discovery metadata, spec compliance. That level of enumeration makes it unmistakable against siblings like payment_options or contract_xray.

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 trigger condition is explicit and front-loaded ('before paying it'), and it points to 'payment_options' for the payment path plus the alternate 0.25 USDC transfer-pass route via pay_tx. It lacks an explicit when-not-to-use statement (e.g. for non-x402 endpoints), so it stops short of full routing guidance.

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