Skip to main content
Glama

inspect_payment_response

Decode and validate an x402 PAYMENT-RESPONSE, surfacing success, payer, network, and amount, and optionally recompute on-chain balance changes to confirm payTo equals the advertised amount.

Instructions

Decode and validate an x402 PAYMENT-RESPONSE, surfacing success, settlement id, payer, network, and amount. Optionally recomputes the on-chain truth: pass rpcUrl + expectedPayTo for a sui:* network (queries sui_getTransactionBlock balanceChanges), or observedBalanceChanges + expectedPayTo for any chain, and it confirms the net balance change to payTo equals the advertised atomic amount (the "recomputed, not trust-the-operator" check). Provide the response via raw (JSON/base64) or json.

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": "inspect_payment_response"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawNoPAYMENT-RESPONSE as a JSON string or base64-encoded JSON.
jsonNoPAYMENT-RESPONSE as an object.
rpcUrlNoOptional. Chain RPC URL; used for the on-chain net-balance check on sui:* networks.
expectedAssetNoOptional. Asset/coin type to filter on (defaults to 0x2::sui::SUI for Sui).
expectedPayToNoOptional. The recipient address to sum net balance change for.
expectedAmountNoOptional. Expected atomic amount; defaults to the response amount.
observedBalanceChangesNoOptional. A balanceChanges array (any chain) to recompute net-to-payTo from, instead of an RPC call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does well on the trust model: it discloses that the recompute mode makes an external RPC call (sui_getTransactionBlock) and what invariant is checked. It omits what happens when validation fails (thrown error vs. a success flag), and says nothing about permissions, RPC latency, or rate limits on the external call.

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-loaded with the core action and surfaced outputs, then the optional recompute path, then the input forms — a logical call order. The parenthetical aside is short and conveys intent rather than padding; no sentence is redundant.

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

Completeness4/5

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

For a 7-parameter tool with no annotations and no output schema, the description compensates well by enumerating returned fields and spelling out the two optional modes. The remaining gap is failure behavior — what a failed recompute returns or raises — which matters for a validation 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 100%, so the baseline is 3, but the description adds genuine cross-parameter semantics the flat schema cannot express: which parameter pairs activate which recompute path, and that the two input modes (raw vs json) are alternatives. This is real meaning beyond the per-field descriptions.

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?

Names a specific verb pair (decode and validate) and a specific resource (x402 PAYMENT-RESPONSE), then enumerates the surfaced fields (success, settlement id, payer, network, amount). It does not differentiate itself from sibling decode_402 or validate_extension, which read as adjacent in purpose, so the agent is left to infer the boundary.

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 conditional guidance inside the tool: use rpcUrl + expectedPayTo for sui:* chains, or observedBalanceChanges + expectedPayTo for any chain, and provide input via raw or json. It stops short of saying when to prefer this tool over decode_402 or validate_extension, and does not state when the recomputation step is unnecessary.

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