Skip to main content
Glama

SpendPreflight

Preflight a payment (allow / hold / block)

preflight_payment
Read-only

Spend preflight for AI agents. Send the x402 PaymentRequired body (v1 or v2) you received, or a cart, plus optional rules (per-payment max, hold threshold, daily cap, allowlists, new-domain days). Returns allow|hold|block with reasons, the cheapest acceptable payment option, and a receipt id. Read-only: never signs, settles, or holds funds. Use before every payment. It includes payee screening in its spending-rule decision. For standalone wallet, name, or domain screening without a payment, use check_payee instead. Each repeat call creates a new receipt and may consume another trial or paid call. Price $0.02 per call (free trial first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cartNoUse instead of challenge for agent checkout / card payments
rulesNoSpending rules; all optional. See get_service_info for defaults.
challengeNoThe x402 PaymentRequired body (v1 or v2) your agent received with HTTP 402
resource_urlNoURL that returned the 402, if not inside the challenge
spent_today_usdNoWhat this agent already spent today, for the daily cap

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
payeeNoPayee screening details
reasonsYesEvery rule that fired, prefixed with its decision
receiptYesLog this for audit
decisionYesPay on allow, ask a human on hold, never pay on block
chosen_optionNoThe cheapest acceptable payment option
options_evaluatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint=true, openWorldHint=true, idempotentHint=false), and the description adds context beyond them: it never signs/settles/holds funds, each repeat call mints a new receipt and may consume another trial or paid call, and it costs $0.02 per call. The non-idempotency implication and cost are exactly the kind of behavioral detail an agent needs before retrying.

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?

Dense but front-loaded: purpose, inputs, outputs, safety, routing, and cost in that order, with no filler sentences. It is longer than strictly necessary for a tool this simple, but each sentence carries operational weight.

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?

Despite an output schema existing, the description still names the return shape (allow|hold|block, reasons, cheapest acceptable option, receipt id), and it covers nested-object inputs, cost, and the sibling alternative. Nothing needed to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 goes further by explaining the two mutually exclusive input modes (x402 PaymentRequired challenge vs. cart) and summarizing what the rules object controls (per-payment max, hold threshold, daily cap, allowlists, new-domain days), giving semantic framing the raw schema doesn't.

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 ("Spend preflight for AI agents") plus the exact decision output (allow|hold|block). It also distinguishes itself from the sibling check_payee by naming it directly, so an agent can route without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Gives an explicit trigger ("Use before every payment"), names the alternative for the adjacent case ("For standalone wallet, name, or domain screening without a payment, use check_payee instead"), and clarifies that payee screening is already bundled here. When-to-use, when-not-to-use, and the alternative are all present.

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