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). 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.

Input Schema

NameRequiredDescriptionDefault
urlYesThe API URL (https)
bodyNoRequest body: a string, or an object sent as JSON
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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the tool does not move funds itself, that it performs sanctions (OFAC) and payout-record checks plus balance verification, that a human signature is required out-of-band (pushed to their phone via Xaman), and what happens on a non-402 response. That is exactly the kind of side-effect and human-in-the-loop context annotations cannot express.

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 what the tool does, then the flow and guardrails, with no filler. It is dense and slightly run-on in places (the seller-check clause and the wallet clause are comma-spliced), but every sentence carries operational information.

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

Completeness5/5

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

For a 6-param, open-world payment tool with no output schema, the description supplies the missing pieces: that the return value is an approve_url (or the API's answer), the required human signing step, the follow-up tool, and the spend/sanctions safeguards. An agent can call this correctly end-to-end from the description alone.

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 documents url, body, method, headers, reason and max_price_usd including the default-1/max-5 cap. The description only alludes to price ('don't pay more than the task needs') without adding format or semantics, so 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?

Specific verb and resource: calls a paid API that answers 402, pays from the user's wallet, and returns an approve_url. It names the chains/currencies and clearly distinguishes itself from payment_status (follow-up) and find_services (seller selection), so an agent can route correctly without opening a 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?

Explicit lifecycle instructions: call find_services first, hand the approve_url to the user, then call payment_status; plus an exclusion ('an API that doesn't ask for payment is just called') and a spend guardrail ('don't pay more than the task needs'). No alternatives are left to inference.

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.