Skip to main content
Glama

Decodificar cabecera de pago x402

x402-payment-decode
Read-onlyIdempotent

Decodifica un valor X-PAYMENT / PAYMENT-SIGNATURE de x402 (JSON en base64, v1 o v2) y revisa su estructura: esquema, red, campos EIP-3009 y formato de firma; opcionalmente lo compara con los PaymentRequirements. Firma no verificada. Cuándo: hay que leer y revisar una cabecera de pago x402 recibida por un vendedor, o armada por un cliente, antes de enviarla a un facilitador. No para: revisar los PaymentRequirements de una respuesta 402 de x402 (x402-requirements-lint). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Decodes an x402 X-PAYMENT / PAYMENT-SIGNATURE value (base64 JSON, v1 or v2) and checks its structure: scheme, network, EIP-3009 authorization fields and signature format; optionally compares it with the PaymentRequirements. Signature not verified. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
headerYesX-PAYMENT (v1) or PAYMENT-SIGNATURE (v2) header value: base64 JSON string, or the decoded object (string or object; required; up to 16448 chars).
requirementsNoOptional PaymentRequirements to compare against: one accepts[] entry, the accepts array or the whole 402 body (object or array; optional; up to 100 items).

Output Schema

NameRequiredDescriptionDefault
shapeNo
validNo
errorsNo
schemeNo
decodedNo
networkNo
warningsNo
signatureNo
x402_versionNo
authorizationNo
network_caip2No
requirement_checksNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Decodes an x402 X-PAYMENT / PAYMENT-SIGNATURE value (base64 JSON, v1 or v2) and checks its structure: scheme, network, EIP-3009 authorization fields and signature format; optionally compares it with the PaymentRequirements. Signature not verified. When: an x402 payment header received by a seller, or built by a client, has to be read and checked before it goes to a facilitator. Not for: linting the PaymentRequirements of an x402 402 response (x402-requirements-lint). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/no-network, but the description adds genuinely new context: the signature is NOT verified (a critical caveat that prevents misuse), the operation is deterministic, and hard limits are given (64 KB input, 1 s per call, 1 MB result). These are exactly the operational constraints annotations cannot express.

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 core action, then cleanly segmented with labeled clauses (Cuándo / No para / Efectos / Determinista / Límites). The bilingual duplication and the pointer to the EN text in inputSchema.description add some bulk, but each labeled clause carries distinct information.

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?

An output schema exists, so return-value description is not required; the description still covers scope, exclusions, side effects, determinism and resource limits. Nothing an agent needs in order to invoke this correctly is missing.

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%, with both `header` and `requirements` fully documented in the schema, so the baseline is 3. The description mentions the optional PaymentRequirements comparison but adds no format or interpretation detail beyond what the parameter descriptions already state.

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 and resource: decodes an x402 X-PAYMENT / PAYMENT-SIGNATURE value (base64 JSON, v1 or v2) and checks scheme, network, EIP-3009 fields and signature format. It explicitly names the sibling it is not (x402-requirements-lint), so an agent can distinguish it without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit 'Cuándo' (a payment header received by a seller or built by a client, before it goes to a facilitator) and an explicit 'No para' routing to x402-requirements-lint for 402-response requirements. Both the use case and the exclusion are named, leaving nothing to inference.

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