Skip to main content
Glama

inspect_payment_response

Read-onlyIdempotent

Decode and validate an x402 PAYMENT-RESPONSE, then optionally recompute on-chain balance changes to confirm the payee received the advertised atomic 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.8/5.0
Behavior4/5

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

Annotations already mark it read-only, idempotent, non-destructive, and open-world, so the baseline is lower. The description adds meaningful behavior: it can query sui_getTransactionBlock balanceChanges, recompute net balance change to payTo, and compare it to the advertised atomic amount. It does not describe failure behavior when validation fails, but the added behavioral context is substantial.

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 description is front-loaded with the core purpose, then moves to optional validation and input modes. It is dense but well organized, with only minor extra phrasing such as the quoted 'recomputed, not trust-the-operator' aside.

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 nested input and no output schema, the description covers the main modes, surfaced result fields, and optional on-chain validation logic. It leaves some edge-case behavior unspecified, such as what happens when the recomputed amount does not match, but it is largely complete.

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 goes beyond individual parameter descriptions by explaining parameter pairings: rpcUrl plus expectedPayTo for sui:* chains, or observedBalanceChanges plus expectedPayTo for any chain, and it clarifies that raw and json are alternative input representations.

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 states a specific verb and resource: decode and validate an x402 PAYMENT-RESPONSE, and it enumerates useful surfaced fields. It does not explicitly distinguish itself from siblings such as decode_402 or check_compliance, so clarity is strong but not fully differentiated.

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?

It explains how to invoke the optional on-chain recomputation and the two input pathways, which gives practical usage context. However, it does not state when to use this tool instead of sibling tools like decode_402 or check_compliance, nor does it give explicit exclusions.

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