Skip to main content
Glama

OceanAlt Pre-Payment Checks

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.

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": {
      "body": "<body>"
    },
    "name": "verify_payment_requirements"
  }
}

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.

  1. Changed1 schema field changed
    • addedInput schema / properties / body / type
      Added value: +[
      +  "object",
      +  "string"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses the full result semantics an agent needs: verified:false reason codes, the benign interpretation of no_signature (seller unprotected, not malicious) versus the tampered interpretation of digest_mismatch/signature_invalid. It also explains the verification model (seller signature vs proxy/CDN/SDK alteration), which annotations cannot convey.

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?

Purpose and safety consequence are front-loaded, and every sentence carries actionable content. It is a dense single block, though, and the result-code breakdown would read better as separate lines rather than being interleaved with the parameter guidance.

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?

There is no output schema, and the description compensates fully by explaining the shape of the outcome (verified flag plus reason_code values and their meanings). With three parameters, one required, and the input modes and default resolution all explained, an agent has everything needed to call and act on 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 already 100%, but the description adds meaning: body accepts either decoded JSON or the raw base64 header value, and expect:{payTo, amount} is explicitly framed as 'what you are about to pay ... checked against the signed fields'. The keys_url default rationale is largely duplicative of its schema text, keeping this just under a 5.

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 opens with a specific verb and object: verify that an x402 402 response's payment requirements (payTo, amount, asset, network, resource) were seller-signed and not altered in transit. It names the exact fields checked and the transport header, which lets an agent distinguish this verification step from the neighbouring decision/checking tools without opening any schema.

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 trigger is explicit: call this 'before paying an x402 402 response', and the guidance extends to outcomes ('do not pay' on digest_mismatch or signature_invalid). It stops short of naming when-not-to-use or a specific sibling alternative for pre-payment decisions, so it is strong context without full routing.

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.