Skip to main content
Glama

PayGate USDT Payment Gateway MCP

build_x402_paywall_challenge

Read-onlyIdempotent

Generate a standards-compliant HTTP 402 (x402 v2) payment challenge JSON payload, base64 PAYMENT-REQUIRED header, and 1-click PayGate checkout_url for monetizing any REST or AI-agent API endpoint in USDT/USDC. Purely read-only deterministic payload builder with zero network calls or side effects. Returns JSON with x402Version (2), amount_usd, checkout_url, payment_required_header_b64, and CAIP-2 accepts array.

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": {
      "resource_url": "<resource_url>",
      "price_usd": "<price_usd>",
      "recipient_wallet": "<recipient_wallet>"
    },
    "name": "build_x402_paywall_challenge"
  }
}

Input Schema

NameRequiredDescriptionDefault
price_usdYesRequired per-call or pass price in USD (e.g. `0.05` or `9.0`).
descriptionNoHuman- and agent-readable description of what the paid endpoint delivers upon settlement.Paid API endpoint (non-custodial USDT/USDC settlement)
resource_urlYesProtected HTTPS endpoint URL being monetized (e.g. `https://api.example.com/v1/pro-signal`).
recipient_walletYesMerchant's EVM wallet address (`0x...`) to receive on-chain USDC/USDT payments across Base, Polygon, Arbitrum, and BSC.

Output Schema

NameRequiredDescriptionDefault
acceptsYes
amount_usdYes
x402VersionYes
checkout_urlYes
payment_required_header_b64No

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false; the description reinforces this with "purely read-only deterministic payload builder with zero network calls or side effects," which is genuinely useful for an agent deciding whether the call is safe to retry. It does not discuss failure modes such as invalid wallet format or unsupported chain, leaving a small 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?

Three tight sentences front-load the produced artifacts, then the behavioral guarantee, then the return shape — zero filler. Density is high (heavy backticking and protocol jargon), but every clause carries information.

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?

An output schema exists, so the enumerated return fields are a bonus rather than a necessity, and the safety profile is covered by annotations plus the explicit "no side effects" statement. Documentation of error conditions or supported-chain constraints on `recipient_wallet` is the only notable omission.

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% and every parameter already carries a descriptive example (`0.05`, `0x...`, sample URL), so the schema does the heavy lifting. The description adds no per-parameter meaning beyond naming the output fields, which is a separate concern — baseline 3 is appropriate.

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 ("Generate") with a precisely named artifact set: an x402 v2 402 challenge JSON, a base64 `PAYMENT-REQUIRED` header, and a `checkout_url`. That clearly separates it from invoice-lifecycle siblings such as `create_usdt_invoice` or `get_usdt_invoice`, which manage invoices rather than stateless challenge payloads.

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?

States the context of use ("monetizing any REST or AI-agent API endpoint in USDT/USDC") which tells the agent this is the paywall-setup step, not a payment verification step. It stops short of naming when to prefer a sibling tool or what prerequisites the merchant must satisfy, so no explicit exclusions are given.

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.