Skip to main content
Glama

x402 payment receipt: decode the payment you sent

x402_receipt
Read-only

Decodes the x402 v2 PAYMENT-SIGNATURE header sent with the request into a readable receipt: x402 version, scheme, CAIP-2 network and chain name, resource URL, the copied payment requirements, payer, recipient, value in atomic units and USD, USDC contract, nonce, validity window in ISO-8601 with seconds to expiry, signature length and prefix, extension keys, and pass/fail diagnostics. Computed locally, no upstream source. Price: $0.002 per successful call, paid in USDC with x402 v2; failed calls and calls that match nothing are not charged.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "x402_receipt"
  }
}

Input Schema

NameRequiredDescriptionDefault
echoNoOptional text up to 200 characters, returned verbatim in the response for request correlation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations only cover readOnlyHint and openWorldHint; the description adds substantial behavior the agent could not otherwise know: the result is computed locally with no upstream source, the call costs $0.002 in USDC on x402 v2, and failed or non-matching calls are free. It also discloses the shape of the returned receipt (including pass/fail diagnostics) in the absence of an output schema.

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?

The purpose is front-loaded in the first clause, followed by a long but load-bearing field enumeration that substitutes for a missing output schema. The pricing sentence earns its place, though the field list is dense enough that it reads as a run-on.

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 and zero required parameters, the description supplies everything needed: what it decodes, what the receipt contains, that computation is local, and what the call costs including the free-call conditions. Nothing an agent needs to invoke it 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?

There is a single optional 'echo' parameter fully documented in the schema (100% coverage), so the schema carries the semantics. The description adds nothing about the parameter and correctly leaves it to the schema; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 resource: 'Decodes the x402 v2 PAYMENT-SIGNATURE header sent with the request into a readable receipt', and enumerates the decoded fields so an agent knows exactly what it produces. It never names the obvious counterpart (x402_preflight), so the pre-payment vs post-payment distinction is left for the agent to infer from 'the payment you sent'.

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

Usage Guidelines3/5

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

'Decode the payment you sent' implies this is a post-payment verification step rather than a pre-purchase check, and the billing note ('failed calls and calls that match nothing are not charged') implies it can be tried speculatively. However, there is no explicit when-to-use statement or named alternative such as x402_preflight, so the agent must infer the ordering itself.

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