Skip to main content
Glama

Verify a signed x402 402 response was not tampered with (free)

verify_payment_requirements
Read-onlyIdempotent

Validate signed x402 payment requirements from decoded PAYMENT-REQUIRED headers, detecting tampered payTo or amount and returning true/false with a reason code.

Instructions

A 402 response is plaintext: any hop between seller and agent (proxy, CDN, a compromised SDK, a malicious tool) can swap the payTo address. Sellers who sign their payment requirements with OceanAlt put extensions.signedRequirements (Ed25519) inside the PAYMENT-REQUIRED header payload. Pass the decoded header JSON (or its raw base64) and, optionally, the payTo / amount you expect; get verified true/false with a reason code: ok | no_signature | digest_mismatch | signature_invalid | key_unavailable | payto_mismatch | amount_mismatch. Defends against tampering in transit, not against a compromised seller origin. Free, no API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expectNoWhat you expect to pay; mismatches are reported.
keys_urlNoWhere the seller publishes its keys (defaults to the keys_url inside the signature).
payment_requiredNoThe decoded PAYMENT-REQUIRED JSON, or the raw base64 header value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/openWorld, and the description adds genuinely new behavioral detail: the full reason-code enumeration (ok | no_signature | digest_mismatch | signature_invalid | key_unavailable | payto_mismatch | amount_mismatch), the guarantee boundary, and 'Free, no API key'. Strong added context beyond structured fields.

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?

Front-loads the threat model, then the mechanism, then the input contract and outcome vocabulary, closing with cost and limitations. Every sentence carries selection-relevant information with no filler.

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 still specifies the return shape ('verified true/false with a reason code') and the enumerated codes, plus auth (no API key) and the limits of the guarantee. Nothing an agent needs to call or interpret it 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; the description adds marginal value by tying the optional expect.payTo/expect.amount inputs to specific outcome codes (payto_mismatch, amount_mismatch) and clarifying that keys_url falls back to the value inside the signature. It reinforces rather than replaces 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 (verify) and resource (signed x402 402 payment requirements) and explains the concrete attack it guards against (transit tampering of payTo). It is clearly distinguishable from sibling screening/tracing/decision tools, which do not touch x402 signing.

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?

Gives clear context for use ('Sellers who sign their payment requirements with OceanAlt...') and an explicit scope boundary: it defends against in-transit tampering, not a compromised seller origin. It stops short of naming an alternative sibling when the seller does not sign, but the when-to-use condition is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.