Skip to main content
Glama

x402 spend preflight

x402_preflight
Read-only

Give it the x402 endpoints your agent is about to call and your spending rules (per-request cap, total budget, allowed networks). It probes every endpoint without paying, in parallel, and returns which ones are safe to pay, the real price in USD, network and pay-to address of each, the total cost, and a plain reason for every endpoint it blocks (over the cap, over budget, testnet only, not a valid x402 endpoint, non-USD price). Use it as a guardrail step in any agent that spends money. Paid tool: $0.005 per call in USDC via x402 at POST https://x402-tools.com/v1/x402-preflight. Calling it here returns the endpoint, price and how to pay.

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": {
      "urls": "<urls>"
    },
    "name": "x402_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlsYes1 to 10 x402 endpoint URLs, or objects { url, method } to probe with POST.
networksNoAllowed networks, e.g. ["base"] or ["eip155:8453"]. Default: any mainnet.
budget_usdNoTotal budget in USD for this batch. Endpoints are approved in order until it runs out.
max_price_usdNoPer-request cap in USD. Endpoints that cost more are blocked.

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 declare readOnlyHint and openWorldHint; the description adds substantial context beyond them: probing happens without payment, in parallel, and blocked endpoints come back with enumerated reasons (over cap, over budget, testnet only, invalid endpoint, non-USD price). It also discloses that this is a paid tool at $0.005/call in USDC via x402 and what calling it through this MCP surface actually returns. That is well past the annotation bar.

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 action and the return contract, then the usage recommendation, then the payment mechanics. The pricing and endpoint sentences are dense but necessary for a paid tool; a little redundancy exists between 'returns which ones are safe to pay' and the block-reason list.

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?

No output schema exists, so the description must define return values, and it does so fully: safe-to-pay set, per-endpoint price/network/pay-to, total cost, and per-endpoint block reasons. For a four-parameter read-only batch probe, nothing an agent needs to call it correctly 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%, so all four parameters are already documented with examples and defaults. The description restates per-request cap, total budget, and allowed networks but adds only mild meaning, namely that endpoints are approved in order and each block gets a plain reason. Baseline 3 is appropriate when the schema carries the load.

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: probe x402 endpoints without paying and return pay-safety, real USD price, network, and pay-to address. The output contract is enumerated precisely, and the distinction from a single-endpoint checker like x402_check is implicit in 'every endpoint' and batch budget logic.

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?

Explicitly frames itself as a guardrail step for any agent that spends money, which tells the agent when to invoke it. It stops short of naming a sibling alternative or stating exclusions (e.g. when a plain x402_check on one endpoint is enough), so it is clear context without 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