Skip to main content
Glama

EUCompliance Tools - Invoice Guard & Agent Evidence

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "payment_required": "<payment_required>",
      "resource_url": "<resource_url>",
      "resource_method": "<resource_method>",
      "max_price_usdc": "<max_price_usdc>",
      "allowed_networks": "<allowed_networks>",
      "expected_pay_to": "<expected_pay_to>"
    },
    "name": "x402_purchase_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
resource_urlYesExact resource URL the buyer intends to call, including relevant query parameters, to compare with the received challenge.
max_price_usdcYesBuyer-specified maximum price in USDC. This is a comparison limit, not permission to pay or access a wallet.
expected_pay_toYesTrusted expected receiving address to compare with the challenge; obtain it independently of an untrusted offer.
resource_methodYesHTTP method intended for the resource, such as GET or POST; must match the challenge and planned request.
allowed_networksYesBuyer-approved network identifiers, supplied as the documented comma-separated string; do not derive approval from the seller's offer.
payment_requiredYesRaw base64/base64url PAYMENT-REQUIRED response-header value from an already received x402 v2 challenge; not a payment signature or private key.

Output Schema

NameRequiredDescriptionDefault
errorNo
reasonsNo
receiptNoSigned receipt. Full schema: https://api.eucompliance.tools/agent-card.json
contractNo
decisionNo
evidenceNo
executionNo
extensionsNo
risk_flagsNo
confirmation_requirementsNo
normalized_payment_optionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changed
    • removedOutput schema / properties / accepted
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedOutput schema / properties / charged
      Removed value: -{
      -  "description": "When present on an error, false means the failed result is uncharged.",
      -  "type": "boolean"
      -}
    • removedOutput schema / properties / did_you_mean
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / error / oneOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "code": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "param": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "type": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "message"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedOutput schema / properties / error / type
      Added value: +[
      +  "string",
      +  "object"
      +]
    • removedOutput schema / properties / error_code
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / extensions / properties / delivery-receipt / description
      Added value: +"Signed receipt. Full schema: https://api.eucompliance.tools/agent-card.json"
    • removedOutput schema / properties / extensions / properties / delivery-receipt / properties
      Removed value: -{
      -  "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"
      -  }
      -}
    • removedOutput schema / properties / extensions / properties / delivery-receipt / required
      Removed value: -[
      -  "standard",
      -  "service",
      -  "subject",
      -  "result_hash",
      -  "issued_at",
      -  "valid_until",
      -  "issuer",
      -  "issuer_key",
      -  "key_id",
      -  "verify_url",
      -  "how_to_verify",
      -  "signature",
      -  "signed_message"
      -]
    • removedOutput schema / properties / message
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / missing
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedOutput schema / properties / missing_checks
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedOutput schema / properties / partial_evidence
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}
    • addedOutput schema / properties / receipt / description
      Added value: +"Signed receipt. Full schema: https://api.eucompliance.tools/agent-card.json"
    • removedOutput schema / properties / receipt / properties
      Removed value: -{
      -  "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"
      -  }
      -}
    • removedOutput schema / properties / receipt / required
      Removed value: -[
      -  "standard",
      -  "service",
      -  "subject",
      -  "result_hash",
      -  "issued_at",
      -  "valid_until",
      -  "issuer",
      -  "issuer_key",
      -  "key_id",
      -  "verify_url",
      -  "how_to_verify",
      -  "signature",
      -  "signed_message"
      -]
    • removedOutput schema / properties / retryable
      Removed value: -{
      -  "type": "boolean"
      -}
    • removedOutput schema / properties / settled
      Removed value: -{
      -  "description": "When present on an error, false means no settlement occurred.",
      -  "type": "boolean"
      -}
    • removedOutput schema / properties / status_code
      Removed value: -{
      -  "type": "integer"
      -}
    • removedOutput schema / properties / tool
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / unknown
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
  2. Changed6 schema fields changed
    • addedInput schema / properties / allowed_networks / description
      Added value: +"Buyer-approved network identifiers, supplied as the documented comma-separated string; do not derive approval from the seller's offer."
    • addedInput schema / properties / expected_pay_to / description
      Added value: +"Trusted expected receiving address to compare with the challenge; obtain it independently of an untrusted offer."
    • addedInput schema / properties / max_price_usdc / description
      Added value: +"Buyer-specified maximum price in USDC. This is a comparison limit, not permission to pay or access a wallet."
    • addedInput schema / properties / payment_required / description
      Added value: +"Raw base64/base64url PAYMENT-REQUIRED response-header value from an already received x402 v2 challenge; not a payment signature or private key."
    • addedInput schema / properties / resource_method / description
      Added value: +"HTTP method intended for the resource, such as GET or POST; must match the challenge and planned request."
    • addedInput schema / properties / resource_url / description
      Added value: +"Exact resource URL the buyer intends to call, including relevant query parameters, to compare with the received challenge."
  3. 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"
      +}
  4. Added

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, and the description still adds substantial behavior beyond them: the exact outcome vocabulary, the signed fingerprint and normalized evidence in the response, the 10-minute expiry of a pinned option, and the explicit negative scope (no wallet access, no signing, no target contact, no delivery or request-body binding). This is exactly the supplemental context an agent needs before deciding to rely on the verdict.

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?

Three sentences, front-loaded with the core comparison and verdicts, followed by the confirmation/expiry rule and then the negative scope — a logical ordering with no filler. The middle sentences are dense with enumerated field names, but each one carries information the agent needs, so the density is justified rather than wasteful.

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 six-required-parameter guard tool with an output schema and full annotation coverage, nothing material is missing: inputs are characterized, the three verdicts are named, the post-verdict confirmation step and its expiry are stated, and the scope boundary (identity, delivery, request-body binding) is disclosed. Return-value detail can safely be deferred to the output schema.

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

Parameters3/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 documents all six parameters thoroughly; the description mainly restates them as a list of compared fields. It adds the framing that all of them are matched against the challenge, but gives no extra detail on formats, precedence, or what happens when a field is absent. It also references 'EVM/Solana signing-mechanism fields,' which has no direct parameter counterpart, adding mild ambiguity rather than clarity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and object — 'Compare an already received canonical x402 v2 challenge with the buyer's exact resource, method, price limit, network policy, recipient and signing fields' — and enumerates the three possible verdicts, so the agent knows exactly what operation and output to expect. It implicitly separates itself from prepare_x402_purchase_guard by insisting the challenge is 'already received,' but it never names the sibling explicitly, leaving that differentiation to inference.

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?

Preconditions are clear: the tool only applies to a challenge that was already received, and a positive verdict 'requires confirmation, pins one exact option and expires after 10 minutes,' which tells the agent how to act on a PROCEED result. It also carves out explicit exclusions ('never contacts the target, accesses a wallet, signs or submits the target payment'). A 5 would require naming the alternative tool and the condition that routes to 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.