Skip to main content
Glama

SpendPreflight

Free basic payment-rule check

preflight_basic
Read-onlyIdempotent

Use when you need free supplied-data rules only; no external evidence or signed receipt. Provide the spent-today context. No automatic paid upgrade. Free rules-only review of a supplied x402 challenge or cart. Rules-only review of caller-supplied data. No sanctions, domain/DNS, identity, cached price/history, liveness, delivery or wallet-authority verification. No signed receipt. An allow decision is not permission to pay. Pass spent_today_usd, including zero, to evaluate the daily cap. Use preflight_payment explicitly for the separate 0.02 USDC screened and signed check. Shared anonymous per-instance 30/minute HTTP+MCP limit.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "preflight_basic"
  }
}

Input Schema

NameRequiredDescriptionDefault
cartNoOptional. Checkout JSON object used instead of challenge; provide exactly one. Example: {"merchant_domain":"example.com","total_usd":1.25,"pay_to":"0xBf4164e07552e4c1b1B1597E72C7acAA3F0a1c58"}. total_usd is a USD number.
rulesNoOptional. Spending-rule JSON object; omitted fields use service defaults available from get_service_info. Example: {"max_per_payment_usd":5,"usdc_only":true}. USD amounts are numbers, not atomic strings.
challengeNoOptional. Actual x402 HTTP 402 PaymentRequired JSON object, version 1 or 2. Required unless cart is supplied; provide exactly one. Example structure: {"x402Version":2,"resource":{"url":"https://api.example.com/data"},"accepts":[{"scheme":"exact","network":"eip155:8453","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","payTo":"0xBf4164e07552e4c1b1B1597E72C7acAA3F0a1c58","amount":"10000","maxTimeoutSeconds":60}]}. Amounts inside challenges are atomic integer strings (10000 = 0.01 USDC at 6 decimals), not decimal USDC.
resource_urlNoOptional. Absolute HTTP(S) resource URL string. Example: https://api.example.com/data. Supply if the resource URL is absent from the challenge or requirement.
resource_methodNoOptional. Advertised HTTP method string, 3–16 letters. Example: POST. Supply when an indexed URL has multiple methods.
spent_today_usdNoOptional. Already-spent daily total as a nonnegative USD number. Example: 2.5. Caller-supplied context for the daily cap.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, closed-world behavior, yet the description still adds real substance: the explicit list of verifications NOT performed (sanctions, DNS, identity, cached price, liveness, delivery, wallet authority), the absence of a signed receipt, and a shared anonymous 30/minute rate limit. The only omission is what the response actually looks like (allow/hold/deny), which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening is well front-loaded with the when-to-use condition, but 'Free rules-only review of a supplied x402 challenge or cart' and 'Rules-only review of caller-supplied data' restate the same idea in consecutive fragments. The list of non-performed checks is long but each item carries information, so the waste is in the duplicated purpose sentences rather than the exclusions.

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 six-parameter tool with nested cart/rules objects and no output schema, the description covers scope, limits, rate limits, and the safety caveat that an allow is not payment authorization. What remains thin is the return shape — no output schema exists and the description never says what decision fields come back.

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 coverage is 100%, so the baseline is 3, but the description goes further by singling out spent_today_usd and instructing that it be passed 'including zero' so the daily cap is actually evaluated — a material behavior the schema marks merely optional. The challenge-vs-cart exclusivity is already in the schema, so no extra credit there.

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 — a free, rules-only review of a caller-supplied x402 challenge or cart — and explicitly contrasts it with preflight_payment's screened, signed check. An agent can distinguish it from the sibling 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?

'Use when you need free supplied-data rules only; no external evidence or signed receipt' gives an explicit trigger condition, and 'Use preflight_payment explicitly for the separate 0.02 USDC screened and signed check' names the alternative and what selects it. It also warns that an allow decision is not permission to pay, which prevents a downstream misuse.

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