Skip to main content
Glama

Pay for an x402 API (your user signs)

pay_x402

Call a paid API that answers 402 Payment Required, paid from your user's own wallet: USDC on Base or Solana, or RLUSD on the XRP Ledger signed in Xaman (pushed to their phone). Escrowed offers on Base (x402 auth-capture, e.g. buying a domain on Atom) are paid too: the USDC is held and only captured when the seller delivers. It doesn't pay by itself: it reads the price, checks the seller (OFAC sanctions list, x402 Doctor's payout record) and your user's balance, and returns an approve_url where your user signs this one payment in their own wallet (also sent to their phone). Give them that link, then call payment_status. An API that doesn't ask for payment is just called, and its answer comes back. Use find_services first to pick a seller with a good record; don't pay more than the task needs.

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": {
      "url": "<url>"
    },
    "name": "pay_x402"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe API URL (https)
bodyNoRequest body: a string, or an object sent as JSON. For a GET, an object (such as a pick's example input) is sent as URL query parameters instead
methodNoHTTP method (default GET)
reasonNoWhat this is for, in a few words: shown to your user when they sign, and on the receipt
headersNoExtra request headers, e.g. content-type
max_price_usdNoThe most this call may cost, in dollars (default 1; at most 5, or 100 for an escrowed payment that is only captured when the seller delivers, such as a domain)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / body / description
      Previous value: -"Request body: a string, or an object sent as JSON"New value: +"Request body: a string, or an object sent as JSON. For a GET, an object (such as a pick's example input) is sent as URL query parameters instead"
  2. Changed2 schema fields changed
    • changedInput schema / properties / max_price_usd / description
      Previous value: -"The most this call may cost, in dollars (default 1, at most 5)"New value: +"The most this call may cost, in dollars (default 1; at most 5, or 100 for an escrowed payment that is only captured when the seller delivers, such as a domain)"
    • changedInput schema / properties / max_price_usd / maximum
      Previous value: -5New value: +100
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say readOnly=false, destructive=false, openWorld=true. The description adds the real behavioral picture: it does not pay by itself, it pre-checks price, OFAC sanctions and seller payout record, escrowed offers are held until the seller delivers, and it returns an approve_url the user must sign in their own wallet. This is exactly the context annotations cannot convey.

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?

Front-loaded with the core action and rail details, then workflow, then guardrail — good ordering. It is a dense single block with several colon-separated clauses, so it reads as slightly overstuffed, but nearly every sentence carries distinct operational 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?

No output schema exists, and the description compensates by explaining that an approve_url is returned plus the downstream payment_status step. Minor gap: it doesn't say what an agent should do if the sanctions/balance pre-check fails or the seller never delivers an escrowed payment.

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 explains url, body, method, headers, reason and max_price_usd including the escrow-specific limit. The description reinforces pricing intent ('don't pay more than the task needs', escrow capture) but adds no syntax or format detail beyond the schema. Baseline 3 applies.

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 — calls a paid API that answers 402 Payment Required — and immediately names the payment rails (USDC on Base/Solana, RLUSD on XRP Ledger) and the escrow variant. An agent can distinguish this from find_services and payment_status 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit ordering and alternatives: use find_services first to pick a seller with a good record, hand the approve_url to the user, then call payment_status. It also states the negative case — an API that doesn't ask for payment is just called — and a spending guardrail ('don't pay more than the task needs').

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.