Skip to main content
Glama

Agent Decision & Evidence Tools (MCP + x402)

x402 Purchase Guard

x402_purchase_guard
Read-only

Compare an already received canonical x402 v2 challenge with the buyer's exact resource, method, USDC price limit, network policy, trusted recipient and EVM/Solana signing-mechanism fields. Returns PROCEED_TO_USER_CONFIRMATION, REVIEW_REQUIRED or REJECT_CHALLENGE with normalized evidence and a signed fingerprint. A positive result requires confirmation, pins one exact option and expires after 10 minutes. Never contacts the target, accesses a wallet, signs or submits the target payment; merchant identity, delivery and target request-body binding are outside scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource_urlYes
max_price_usdcYes
expected_pay_toYes
resource_methodYes
allowed_networksYes
payment_requiredYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNo
errorNo
chargedNoWhen present on an error, false means the failed result is uncharged.
messageNo
missingNo
reasonsNo
receiptNo
settledNoWhen present on an error, false means no settlement occurred.
unknownNo
acceptedNo
contractNo
decisionNo
evidenceNo
executionNo
retryableNo
error_codeNo
extensionsNo
risk_flagsNo
status_codeNo
did_you_meanNo
missing_checksNo
partial_evidenceNo
confirmation_requirementsNo
normalized_payment_optionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / allowed_networks / items / enum
      Added value: +[
      +  "eip155:8453",
      +  "eip155:42161",
      +  "eip155:137",
      +  "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
      +]
    • addedInput schema / properties / allowed_networks / maxItems
      Added value: +4
    • addedInput schema / properties / allowed_networks / minItems
      Added value: +1
    • removedInput schema / properties / allowed_networks / title
      Removed value: -"Allowed Networks"
    • addedInput schema / properties / allowed_networks / uniqueItems
      Added value: +true
    • removedInput schema / properties / expected_pay_to / title
      Removed value: -"Expected Pay To"
    • addedInput schema / properties / max_price_usdc / pattern
      Added value: +"^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
    • removedInput schema / properties / max_price_usdc / title
      Removed value: -"Max Price Usdc"
    • addedInput schema / properties / payment_required / maxLength
      Added value: +65536
    • addedInput schema / properties / payment_required / minLength
      Added value: +1
    • removedInput schema / properties / payment_required / title
      Removed value: -"Payment Required"
    • addedInput schema / properties / resource_method / enum
      Added value: +[
      +  "GET",
      +  "POST",
      +  "PUT",
      +  "PATCH",
      +  "DELETE",
      +  "HEAD",
      +  "OPTIONS"
      +]
    • removedInput schema / properties / resource_method / title
      Removed value: -"Resource Method"
    • addedInput schema / properties / resource_url / format
      Added value: +"uri"
    • removedInput schema / properties / resource_url / title
      Removed value: -"Resource Url"
    • removedInput schema / title
      Removed value: -"x402_purchase_guard_toolArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "contract",
      +        "decision",
      +        "reasons",
      +        "risk_flags",
      +        "normalized_payment_options",
      +        "evidence",
      +        "execution",
      +        "confirmation_requirements",
      +        "receipt",
      +        "extensions"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "description": "Structured result contract for x402_purchase_guard. A success satisfies the documented success branch. A domain or tool error includes error and is not a successful settlement; unpaid x402 requirements are carried by the transport wrapper.",
      +  "properties": {
      +    "accepted": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "charged": {
      +      "description": "When present on an error, false means the failed result is uncharged.",
      +      "type": "boolean"
      +    },
      +    "confirmation_requirements": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "contract": {
      +      "type": "string"
      +    },
      +    "decision": {
      +      "enum": [
      +        "PROCEED_TO_USER_CONFIRMATION",
      +        "REVIEW_REQUIRED",
      +        "REJECT_CHALLENGE"
      +      ],
      +      "type": "string"
      +    },
      +    "did_you_mean": {
      +      "additionalProperties": true,
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "oneOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "code": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "message": {
      +              "type": "string"
      +            },
      +            "param": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "type": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "message"
      +          ],
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    "error_code": {
      +      "type": "string"
      +    },
      +    "evidence": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "execution": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "extensions": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "delivery-receipt": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "how_to_verify": {
      +              "type": "string"
      +            },
      +            "issued_at": {
      +              "format": "date-time",
      +              "type": "string"
      +            },
      +            "issuer": {
      +              "type": "string"
      +            },
      +            "issuer_key": {
      +              "type": "string"
      +            },
      +            "key_id": {
      +              "type": "string"
      +            },
      +            "result_hash": {
      +              "type": "string"
      +            },
      +            "service": {
      +              "type": "string"
      +            },
      +            "signature": {
      +              "type": "string"
      +            },
      +            "signed_message": {
      +              "type": "string"
      +            },
      +            "standard": {
      +              "const": "eucompliance-receipt/2",
      +              "type": "string"
      +            },
      +            "subject": {
      +              "type": "string"
      +            },
      +            "valid_until": {
      +              "format": "date-time",
      +              "type": "string"
      +            },
      +            "verify_url": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "standard",
      +            "service",
      +            "subject",
      +            "result_hash",
      +            "issued_at",
      +            "valid_until",
      +            "issuer",
      +            "issuer_key",
      +            "key_id",
      +            "verify_url",
      +            "how_to_verify",
      +            "signature",
      +            "signed_message"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "delivery-receipt"
      +      ],
      +      "type": "object"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "missing": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "missing_checks": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "normalized_payment_options": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "partial_evidence": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "reasons": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "receipt": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "how_to_verify": {
      +          "type": "string"
      +        },
      +        "issued_at": {
      +          "format": "date-time",
      +          "type": "string"
      +        },
      +        "issuer": {
      +          "type": "string"
      +        },
      +        "issuer_key": {
      +          "type": "string"
      +        },
      +        "key_id": {
      +          "type": "string"
      +        },
      +        "result_hash": {
      +          "type": "string"
      +        },
      +        "service": {
      +          "type": "string"
      +        },
      +        "signature": {
      +          "type": "string"
      +        },
      +        "signed_message": {
      +          "type": "string"
      +        },
      +        "standard": {
      +          "const": "eucompliance-receipt/2",
      +          "type": "string"
      +        },
      +        "subject": {
      +          "type": "string"
      +        },
      +        "valid_until": {
      +          "format": "date-time",
      +          "type": "string"
      +        },
      +        "verify_url": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "standard",
      +        "service",
      +        "subject",
      +        "result_hash",
      +        "issued_at",
      +        "valid_until",
      +        "issuer",
      +        "issuer_key",
      +        "key_id",
      +        "verify_url",
      +        "how_to_verify",
      +        "signature",
      +        "signed_message"
      +      ],
      +      "type": "object"
      +    },
      +    "retryable": {
      +      "type": "boolean"
      +    },
      +    "risk_flags": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "settled": {
      +      "description": "When present on an error, false means no settlement occurred.",
      +      "type": "boolean"
      +    },
      +    "status_code": {
      +      "type": "integer"
      +    },
      +    "tool": {
      +      "type": "string"
      +    },
      +    "unknown": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A4.1/5.0
Behavior5/5

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

The description adds meaningful behavior beyond the readOnlyHint annotation: the result is ephemeral (expires after 10 minutes), a positive result requires confirmation and pins one option, and the tool has no side effects on wallets or external targets. No contradiction exists between the description and annotations.

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?

The description is compact and front-loaded with the core comparison, then returns, then side-effect guarantees and exclusions. Nearly every sentence earns its place, though the long first sentence is dense and could be broken down for easier parsing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description supplies strong behavioral and scoping context, and an output schema exists so return details need not be repeated. However, for a 6-parameter tool with zero parameter-level schema documentation, the missing explanation of payment_required and the exact field semantics leave an important gap.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only maps some parameters at a high level (resource, method, USDC price limit, network policy, trusted recipient). The critical 'payment_required' parameter is not explained, and 'EVM/Solana signing-mechanism fields' does not map clearly to any specific schema field.

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 description names a specific action ('Compare an already received canonical x402 v2 challenge with the buyer's exact... fields') and a concrete resource, with clear output statuses. It also distinguishes itself from likely siblings by emphasizing the challenge is already received and that the tool never contacts the target or submits payment.

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 a clear context for use: it operates on an already received canonical challenge and never contacts the target, accesses a wallet, signs, or submits payment. It also explicitly lists what is outside scope, but it does not name an alternative tool such as prepare_x402_purchase_guard or state when to prefer it.

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.