Skip to main content
Glama

Offline buyer payment-policy consistency check

x402.policy_check

Decode a caller-supplied merchant PAYMENT-REQUIRED header and evaluate each accepts[] option against an explicit buyer policy (networks, pay_to, assets, max atomic amount). Does not fetch merchant URLs or settle the inspected purchase. Unpaid → PaymentRequired for this server's analysis fee; pay via _meta['x402/payment']. Pass policy as a JSON object string.

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": {
      "payment_required_header": "<payment_required_header>",
      "policy": "<policy>"
    },
    "name": "x402.policy_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYesBuyer policy JSON object as a string. Example: {"allowed_networks":["eip155:84532"],"max_amount_atomic":"10000000"}
agent_idNoOptional agent identity for quota accounting.
request_digestNoOptional JSON string with canonical_url, http_method, body_sha256.
idempotency_keyNoOptional idempotency key (max 128 chars).
payment_required_headerYesInspected merchant PAYMENT-REQUIRED header value (base64 wire from HTTP 402).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and openWorldHint=true; the description explains why this is not a pure read – an unpaid call returns PaymentRequired for an analysis fee, with the payment path given as _meta['x402/payment']. It also clarifies the operation is offline and non-settling, which the annotations cannot express. It leaves the shape of the evaluation result unstated.

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?

Scope is front-loaded in the first sentence, followed by exclusions and then the payment precondition – a sensible order. The text is dense with protocol jargon but each sentence contributes information; nothing is clearly padding.

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 five-parameter, no-output-schema tool, the description covers the input contract, the offline guarantee, and the paid-access gate. The main omission is what a successful evaluation returns (per-option pass/fail verdicts), which matters since no output schema exists to explain it.

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 coverage is 100%, so the baseline is 3. The description adds that policy is passed as a JSON object string and hints at its keys, but the schema already carries the example and per-parameter descriptions for agent_id, request_digest, and idempotency_key are not reinforced.

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: decode a PAYMENT-REQUIRED header and evaluate each accepts[] option against a buyer policy, enumerating the policy dimensions (networks, pay_to, assets, max atomic amount). The negative scope ('Does not fetch merchant URLs or settle the inspected purchase') separates it cleanly from siblings like x402.pay_and_fetch and x402.verify.

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 negative constraints tell the agent when this tool is not the right one (no fetching, no settlement), and the payment sentence establishes the precondition for invocation. It never names a specific sibling alternative, so the routing advice is implicit rather than explicit.

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