Skip to main content
Glama

x402 Payment Preflight Decision

x402_payment_preflight_decision
Read-onlyIdempotent

Offline, read-only preflight check of an x402 v2 PAYMENT-REQUIRED against declared intent before paying. No network calls, signing, settlement, or execution. Returns deterministic PAY (consistent), REVIEW (material change vs previous_snapshot), or DO_NOT_PAY (intent mismatch). USE WHEN: verifying x402 payment requirements before payment. DO NOT USE WHEN: executing, signing, settling, checking balances, or assessing safety. PAY means consistency only, not a safety guarantee.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "intent": {
        "seller": "STRAELO",
        "service": "Straelo Relay",
        "resource": "https://relay.straelo.com/x402-payment-preflight-decision",
        "expected_amount": "0.005",
        "amount_tolerance": "0"
      },
      "payment_required": {
        "accepts": [
          {
            "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "payTo": "0x267ead21c0a5c1bf7e44cb357641556edc52d232",
            "amount": "5000",
            "scheme": "exact",
            "network": "eip155:8453"
          }
        ],
        "resource": {
          "url": "https://relay.straelo.com/x402-payment-preflight-decision",
          "serviceName": "Straelo Relay"
        },
        "x402Version": 2
      }
    },
    "name": "x402_payment_preflight_decision"
  }
}

Input Schema

NameRequiredDescriptionDefault
intentYesBuyer-declared payment policy: expected seller label, service, resource URL, and optional payment constraints (asset, network, destination, amount, tolerance) used to evaluate consistency against the observed x402 challenge.
payment_requiredYesObserved x402 v2 PAYMENT-REQUIRED challenge decoded as JSON.
previous_snapshotNoOptional prior snapshot for stateless material-change detection against a prior result.

Output Schema

NameRequiredDescriptionDefault
changesYesMaterial changes between current result and previous_snapshot; any change drives REVIEW when no mismatch exists.
matchedYesIntent fields that matched the observed x402 payment requirement.
coverageYesScope of the offline comparison: what is and is not evaluated by this preflight.
decisionYesDeterministic preflight payment decision: PAY when intent matches the observed requirement and no material change; REVIEW when consistent but materially changed from previous_snapshot; DO_NOT_PAY when any intent field mismatches the observed requirement.
evidenceYesDerived solely from the supplied intent and payment_required; contains the parsed payment requirement, seller label, and resource domain.
snapshotYesReusable stateless comparison state for detecting material changes on a subsequent call.
assessmentYesConsistency decision only; never a safety rating.
mismatchedYesIntent fields that mismatched the observed x402 payment requirement; any mismatch drives DO_NOT_PAY.
reason_codesYesMachine-readable codes explaining the decision; mismatch codes when DO_NOT_PAY, change codes when REVIEW.
checks_skippedYesChecks skipped because the corresponding expected field was not declared in intent.
external_callsYesAlways empty in this offline MVP.
checks_performedYesConsistency checks actually executed for this request.
payment_fingerprintYesSHA-256 of canonical material payment fields.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "intent": {
      +      "amount_tolerance": "0",
      +      "expected_amount": "0.005",
      +      "resource": "https://relay.straelo.com/x402-payment-preflight-decision",
      +      "seller": "STRAELO",
      +      "service": "Straelo Relay"
      +    },
      +    "payment_required": {
      +      "accepts": [
      +        {
      +          "amount": "5000",
      +          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      +          "network": "eip155:8453",
      +          "payTo": "0x267ead21c0a5c1bf7e44cb357641556edc52d232",
      +          "scheme": "exact"
      +        }
      +      ],
      +      "resource": {
      +        "serviceName": "Straelo Relay",
      +        "url": "https://relay.straelo.com/x402-payment-preflight-decision"
      +      },
      +      "x402Version": 2
      +    }
      +  }
      +]
  2. Changed12 schema fields changed
    • addedInput schema / properties / intent / description
      Added value: +"Buyer-declared payment policy: expected seller label, service, resource URL, and optional payment constraints (asset, network, destination, amount, tolerance) used to evaluate consistency against the observed x402 challenge."
    • changedInput schema / properties / previous_snapshot / description
      Previous value: -"Optional prior snapshot for stateless material-change detection."New value: +"Optional prior snapshot for stateless material-change detection against a prior result."
    • addedOutput schema / properties / changes / description
      Added value: +"Material changes between current result and previous_snapshot; any change drives REVIEW when no mismatch exists."
    • addedOutput schema / properties / checks_performed / description
      Added value: +"Consistency checks actually executed for this request."
    • addedOutput schema / properties / checks_skipped / description
      Added value: +"Checks skipped because the corresponding expected field was not declared in intent."
    • addedOutput schema / properties / coverage / description
      Added value: +"Scope of the offline comparison: what is and is not evaluated by this preflight."
    • changedOutput schema / properties / decision / description
      Previous value: -"Deterministic preflight payment decision."New value: +"Deterministic preflight payment decision: PAY when intent matches the observed requirement and no material change; REVIEW when consistent but materially changed from previous_snapshot; DO_NOT_PAY when any intent field mismatches the observed requirement."
    • addedOutput schema / properties / evidence / description
      Added value: +"Derived solely from the supplied intent and payment_required; contains the parsed payment requirement, seller label, and resource domain."
    • addedOutput schema / properties / matched / description
      Added value: +"Intent fields that matched the observed x402 payment requirement."
    • addedOutput schema / properties / mismatched / description
      Added value: +"Intent fields that mismatched the observed x402 payment requirement; any mismatch drives DO_NOT_PAY."
    • addedOutput schema / properties / reason_codes / description
      Added value: +"Machine-readable codes explaining the decision; mismatch codes when DO_NOT_PAY, change codes when REVIEW."
    • changedOutput schema / properties / snapshot / description
      Previous value: -"Reusable stateless comparison state."New value: +"Reusable stateless comparison state for detecting material changes on a subsequent call."
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=false, and destructiveHint=false, and the description adds materially beyond that: no network calls or signing occur, results are deterministic, and a REVIEW outcome is defined as a material change against previous_snapshot. It also states an important limitation that PAY means consistency only and is not a safety guarantee, which correctly sets expectations for an advisory output.

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

Conciseness5/5

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

The description is dense and front-loaded: purpose first, then the off-limits operations, then the three outcome values and their meaning. The 'USE WHEN'/'DO NOT USE WHEN' labelling makes it scannable, and the brief restatement of no network calls reinforces rather than wastes space.

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?

For a three-parameter nested tool with an output schema, the description covers what is evaluated (observed challenge vs. declared intent), the three possible verdicts, the role of the optional prior snapshot, and the key caveat about what PAY does not mean. Nothing an agent needs in order to call this correctly or interpret the result class 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 schema already carries the parameter documentation and a baseline of 3 applies. The description nonetheless adds semantic value by explaining that previous_snapshot drives stateless material-change detection and that outcomes are judged against the declared intent, giving the agent reason-level understanding of how inputs map to the three verdicts.

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?

The opening sentence names a specific verb and resource: an offline, read-only preflight check of an x402 v2 PAYMENT-REQUIRED against a declared intent before paying. It also scopes what the tool is not (no network calls, signing, settlement, or execution), which cleanly separates it from the execution-oriented siblings. An agent can identify this as a decision/advisory tool rather than an action tool 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 description gives explicit 'USE WHEN: verifying x402 payment requirements before payment' and 'DO NOT USE WHEN: executing, signing, settling, checking balances, or assessing safety', which is strong when/when-not guidance with exclusions. It stops short of naming specific alternative sibling tools (for example the execution decision or balance lookup tools), so routing is by category rather than by named tool.

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