Skip to main content
Glama

Verify a signed x402 402 response (free)

verify_payment_requirements
Read-onlyIdempotent

Before paying an x402 402 response, check that its payment requirements (payTo, amount, asset, network, resource) were signed by the seller and not altered in transit by a proxy, CDN, SDK or another tool. x402 v2 carries the requirements in the PAYMENT-REQUIRED response header (base64 JSON): pass either the decoded JSON or the raw base64 value as body. Optionally pass expect:{payTo, amount} — the address and amount you are about to pay — and the tool also checks they match what was signed. verified:false with reason_code no_signature means the seller does not sign (unprotected, not necessarily malicious); digest_mismatch or signature_invalid means the response was tampered with — do not pay.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesThe decoded PAYMENT-REQUIRED header JSON (object), or the raw base64 header value (string).
expectNoWhat you are about to pay; checked against the signed fields.
keys_urlNoOverride the seller's public-key URL (defaults to extensions.signedRequirements.keys_url).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body / description
      Previous value: -"The 402 response JSON exactly as received."New value: +"The decoded PAYMENT-REQUIRED header JSON (object), or the raw base64 header value (string)."
    • removedInput schema / properties / body / type
      Removed value: -"object"
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (readOnlyHint, idempotentHint, openWorldHint), and the description adds substantial extra context: the meaning of reason_code values (no_signature = unprotected but not necessarily malicious vs digest_mismatch/signature_invalid = tampered), and what verified:false implies. This is behaviorally rich beyond the 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?

Front-loaded with the decision-relevant rule ('before paying...'), then input mechanics, then failure semantics. Some sentences are dense and long, but nearly all content earns its place; minor tightening possible in the x402 v2 header explanation.

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?

With no output schema, the description carries the return-value burden and does so: it explains verified:false, reason_code variants, and the required action. Combined with the accept-either-JSON-or-base64 input guidance, an agent has everything needed to call and interpret this tool.

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 adds meaning to 'expect' beyond the schema: it is what you are about to pay and is matched against the signed fields, plus it clarifies x402 v2 carries requirements in the PAYMENT-REQUIRED header. The keys_url default behavior is largely already in the schema.

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+resource: verifying that x402 402 payment requirements (payTo, amount, asset, network, resource) were signed by the seller and not tampered with. It clearly distinguishes itself from sibling tools like payment_decision and screen_address by scoping to signature/tamper verification of the response itself.

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?

Explicitly frames usage: 'Before paying an x402 402 response, check that...' and gives actionable interpretation ('do not pay' on digest_mismatch/signature_invalid). It does not name alternative sibling tools (e.g. payment_decision) or state when to skip this step, so it falls short of full when/when-not/alternatives coverage.

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