Skip to main content
Glama

x402 Payment Preflight Decision

x402_payment_preflight_decision
Read-onlyIdempotent

Check an x402 payment request before signing or paying and return a deterministic PAY, REVIEW or DO_NOT_PAY decision. USE WHEN: agent needs deterministic verification of a payment requirement before deciding whether to pay. DO NOT USE WHEN: agent expects this tool to execute the payment. Offline/read-only preflight: no network calls, signing, settlement, or payment execution. Decision derives from comparing declared intent against the supplied x402 v2 PAYMENT-REQUIRED; mismatches yield DO_NOT_PAY, material snapshot changes yield REVIEW, consistency yields PAY.

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. 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."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover read-only and idempotency, yet the description adds what the annotations cannot: no network calls, no signing, no settlement, and the decision derivation rule (mismatch to DO_NOT_PAY, material snapshot change to REVIEW, consistency to PAY). Determinism and offline semantics are exactly the behavioral context an agent needs before trusting the result.

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-loads purpose in the first sentence, then structured USE WHEN / DO NOT USE WHEN / behavior blocks. Dense but every sentence carries distinct information; only the final derivation sentence is slightly compressed rather than wasted.

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?

Output schema exists, so return values need no explanation, and the decision enum semantics are still spelled out. Nested intent parameters, the snapshot mechanism, and the offline safety profile are all covered, leaving nothing an agent needs in order to call this correctly.

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% and nested fields are thoroughly documented, so the baseline is 3. The description earns an increment by explaining the relationship between inputs: the declared intent is compared against the supplied x402 v2 PAYMENT-REQUIRED, and previous_snapshot drives stateless material-change detection, which clarifies the third optional parameter's role.

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 ('Check an x402 payment request before signing or paying') and names the concrete output (deterministic PAY, REVIEW or DO_NOT_PAY decision). The DO_NOT_USE_WHEN line separates it from execution/payment siblings such as evm_transaction_execution_decision.

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?

Explicit USE WHEN and DO NOT USE WHEN clauses give both the trigger condition and the exclusion, so an agent knows this is a verification gate, not a payment action. The boundary against execution is stated outright rather than left to inference.

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