Skip to main content
Glama

x402 preflight: inspect a paid endpoint before paying

x402_preflight
Read-only

Sends an unpaid GET to an x402 endpoint and reports what it would charge before paying: HTTP status, redirects (max 3, re-validated), v2 PAYMENT-REQUIRED header or v1 body challenge and its validity, each accepts entry (scheme, CAIP-2 network/name, atomic amount, USD for canonical USDC, asset check, payTo, timeout, EIP-712 name/version), OFAC SDN payTo screen, resource, Bazaar extension, risk flags, host context from registry RDAP (registrar, domain age) and Cloudflare DoH. Price: $0.005 per successful call, paid in USDC with x402 v2; failed calls and calls that match nothing are not charged.

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
urlYeshttps:// URL of the x402 endpoint, including any query string, up to 2048 characters. Default port only; no embedded credentials, IP-address hosts, localhost or private names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only cover readOnlyHint and openWorldHint; the description adds substantially beyond them: no auth/payment is sent, redirects are capped at 3 and re-validated, and the call costs $0.005 only on success. It also discloses what the response contains (status, PAYMENT-REQUIRED v2 header vs v1 body challenge, per-accepts fields, OFAC screen, risk flags, RDAP/DoH host context), which is exactly the burden the description must carry with no output schema.

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?

Purpose and pricing consequence are front-loaded, and the long parenthetical enumerates real return fields rather than filler. The core sentence is dense and run-on, which slows scanning, but almost every clause carries information an agent needs.

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 no output schema and openWorldHint=true, the description must convey both the return payload and the safety/cost profile, and it does: status, redirect handling, challenge format and validity, accepts-entry fields, screening, risk flags, and billing rules. Nothing material for correct invocation 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?

There is a single parameter at 100% schema coverage, and the schema description already spells out the URL constraints (2048 chars, default port only, no credentials/IP/localhost/private names). The description adds only that the request is an unpaid GET, which is behavioral rather than parameter-level, so 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?

"Sends an unpaid GET to an x402 endpoint and reports what it would charge before paying" names a specific action (unpaid probe + price report) on a specific resource (x402 endpoint), and the 'preflight' framing separates it from x402_find (discovery) and x402_receipt (post-payment proof). An agent can select 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 Guidelines4/5

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

The title and body make the use case explicit: inspect an endpoint before paying it, with a stated billing consequence ("failed calls and calls that match nothing are not charged") that shapes retry behavior. It stops short of naming alternatives or stating when not to use it, so it is clear context without explicit exclusion/routing.

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