Skip to main content
Glama

x402 preflight: ALLOW / WARN / DENY before an agent pays an x402 endpoint

x402_preflight

Use when an agent is about to pay an unknown x402 endpoint and needs a cheap safety gate. Input: url (https x402 resource), method, optional max_price_usd. Output: JSON verdict ALLOW/WARN/DENY with reasons: live quote now, price vs similar routes and your budget, payTo on the OFAC list, price change vs our last measurement, our 7-day uptime/p95, ERC-8004 registration. Never pays; cached 60 s. Example: ?url=https://1gateway.dev/v1/fx/rates&max_price_usd=0.01 Price: $0.002 USDC (Base or Solana) via x402.

Input Schema

NameRequiredDescriptionDefault
urlYeshttps URL of the x402 resource you are about to pay
methodNoHTTP method of the resource
max_price_usdNoYour budget per call in USD; a higher quote gives DENY

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/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 burden and does well: 'Never pays' declares the read-only safety profile, 'cached 60 s' discloses freshness behavior, and the verdict reasons (OFAC payTo, price drift, uptime/p95) explain what the check actually examines. It stops short of stating rate limits, failure/error behavior, or whether results are logged.

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 trigger, then input, output, behavior, example, and price in a compact sequence where each clause contributes. The terse colon-delimited style is dense but readable; a couple of items (e.g. the trailing price line) could be trimmed.

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 annotations and no output schema, yet the description fully compensates: it enumerates the input shape, the return verdict and its component reasons, the non-paying/caching behavior, and a worked example. An agent has everything needed to call it correctly.

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 is already documented in the schema, including the max_price_usd-to-DENY relationship. The description restates the three inputs and supplies one concrete example URL with max_price_usd, but adds no format or edge-case detail beyond the schema.

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 action and scope: a pre-payment safety gate that returns ALLOW/WARN/DENY for an x402 endpoint. The 'about to pay' framing implicitly separates it from x402_verify and x402_lint, but no sibling is named, so an agent must infer the boundary itself.

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?

'Use when an agent is about to pay an unknown x402 endpoint and needs a cheap safety gate' gives a clear trigger, and the $0.002 price lets an agent weigh cost against the benefit. There is no explicit 'when not to use' or pointer to the sibling verify/lint tools for other phases.

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