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

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.

No schema history has been recorded yet.

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/idempotent annotations, the description explains key behavioral outcomes: verified:false reason_code no_signature means unprotected but not necessarily malicious, while digest_mismatch or signature_invalid means tampering and must not be paid. It also explains the expected body formats and the optional expect check.

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 front-loaded with the core action and usage condition, then proceeds to format details, optional checks, and failure interpretation. Every sentence carries security-relevant information without repetition.

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 security verification tool with three params and no output schema, the description covers the critical context: where the signed requirements come from, acceptable input forms, optional expected-payment matching, and how to interpret false verification results. Nothing essential for correct invocation or safety 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 coverage is 100%, so the baseline is 3, but the description adds meaningful semantics beyond the schema: body may be decoded JSON or raw base64 from the PAYMENT-REQUIRED header, and expect checks the payTo/amount about to be paid against signed values. keys_url is only weakly covered in the description, though the schema documents it.

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 states a specific verb and resource: verify that an x402 402 response's payment requirements were signed by the seller and not altered in transit. It clearly distinguishes this from generic payment checks by naming the exact fields checked (payTo, amount, asset, network, resource) and the security condition (proxy/CDN/SDK tampering).

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?

It gives a clear when-to-use context — before paying an x402 402 response — and explicitly says not to pay when tampering is indicated. It does not name sibling alternatives such as check_payment_request or payment_decision, so it falls short of full when-vs-alternatives guidance.

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.