Skip to main content
Glama

x402_inspect_payment_header

Read-onlyIdempotent

Parse and audit HTTP 402 payment headers across CAIP-2 networks, flagging invalid amounts, expired or future validity, untrusted assets, and payee mismatches.

Instructions

Parse & audit HTTP 402 PAYMENT-REQUIRED, X-PAYMENT, and PAYMENT-SIGNATURE headers (JSON, base64, or base64url JSON) across CAIP-2 networks (eip155:8453 Base USDC EIP-3009 TransferWithAuthorization, eip155:84532 Base Sepolia, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, stacks:1 sBTC). Flags IEEE-754 floats, zero/negative atomic amounts, expired validBefore, future validAfter, untrusted asset contracts, and payee mismatch.

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": {
      "header_value": "<header_value>"
    },
    "name": "x402_inspect_payment_header"
  }
}

Input Schema

NameRequiredDescriptionDefault
header_nameNoHTTP header name (`PAYMENT-REQUIRED`, `X-PAYMENT`, or `PAYMENT-SIGNATURE`).PAYMENT-REQUIRED
header_valueYesRaw JSON string, base64/base64url string, or JSON object from `PAYMENT-REQUIRED`, `X-PAYMENT`, or `PAYMENT-SIGNATURE`.
expected_payeeNoOptional expected recipient wallet/principal address (`payTo` / `authorization.to`).
reference_unix_tsNoOptional deterministic Unix timestamp (seconds) for `validAfter` / `validBefore` evaluation.
trusted_assets_onlyNoReject asset contracts outside canonical Base/Sepolia USDC, Solana USDC/SOL, and Stacks sBTC.
max_acceptable_minorNoOptional integer ceiling in atomic units above which the challenge is rejected.
expected_caip2_networkNoOptional required CAIP-2 network identifier (e.g. `eip155:8453`).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered; the description still adds real behavior context by listing the specific anomalies it flags (IEEE-754 floats, zero/negative atomic amounts, time-window violations, untrusted assets, payee mismatch). It does not describe the shape of the audit findings it produces, which is the main remaining gap.

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?

Two sentences, front-loaded with the verb and resource, with the validation list placed after the scope definition. The dense CAIP-2 identifiers add length but are load-bearing, so nothing is clearly wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With seven parameters and no output schema, the description should ideally explain what the audit returns (pass/fail, findings list, normalized header). It fully covers inputs and safety but leaves the return contract unspecified, which is a meaningful omission for an inspection tool.

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%, so the schema already documents all seven parameters, making baseline 3 appropriate. The description does add linkage value by tying the allowed encodings (JSON, base64, base64url JSON) to header_value and by naming the payee-mismatch and asset-trust checks that correspond to expected_payee and trusted_assets_only, but it adds no syntax or format detail beyond 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?

Uses a specific verb pair ('Parse & audit') on a specific resource ('HTTP 402 PAYMENT-REQUIRED, X-PAYMENT, PAYMENT-SIGNATURE headers') and names the exact networks and schemes covered. An agent can distinguish this read-only inspection tool from siblings like x402_verify_settlement_webhook or x402_convert_atomic_units 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 enumeration of accepted header formats and the checks performed (expired validBefore, untrusted asset contracts, payee mismatch) makes the use case clear: validating a 402 challenge or payment header before acting on it. It does not explicitly name an alternative tool or state when not to use it, so it stops short of full routing guidance.

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