Skip to main content
Glama

Pay an x402 endpoint in USDC or $THREE and return its result

pay_and_call
Destructive

Pay for and call a paid x402 endpoint, settling payment automatically. Supports self-custodial signing or session-governed payment via three.ws token.

Instructions

Call a paid x402 endpoint and settle the payment automatically, then return the result.

Two modes: • Self-custodial (default): signs with SOLANA_SECRET_KEY or secret arg — you hold the key. • Session-governed: pass session_token (a three.ws Payment Session token) — the platform wallet signs on your behalf; the session's budget, allowlist, and per-tx cap are enforced by the platform. No private key required. Supports Solana USDC and Base USDC sessions.

Pay in USDC (default) or, when the endpoint advertises it, in $THREE (set token:"three"). Bounded by max_usd and the MAX_PAY_USD cap; refuses before any money moves if the price is over the cap. With REQUIRE_CONFIRM on, the call refuses until re-issued with confirm:true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe x402 endpoint to pay and call.
bodyNoJSON body for POST requests.
tokenNoSettlement token. "usdc" (default) or "three" — the $THREE platform token; the endpoint must advertise it. Ignored when session_token is set.usdc
methodNoHTTP method.GET
secretNoPer-call base58 signer override (defaults to SOLANA_SECRET_KEY). Ignored when session_token is set.
confirmNoMust be true to execute when REQUIRE_CONFIRM is on.
max_usdNoHard ceiling for THIS call in USD. Can only lower the MAX_PAY_USD cap, never raise it.
session_tokenNothree.ws Payment Session token (pss_…). When provided, the platform wallet pays — no local key needed. Overrides `secret`.
idempotency_keyNoDeduplication key for this call. Recommended when using session_token to avoid double-charges on retries.
Behavior4/5

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

Discloses key behaviors: automatic payment settlement, two signing modes, bounded by max_usd and MAX_PAY_USD cap, refusal before money moves if over cap, confirmation requirement, and token override behavior. Annotations (destructiveHint=true) are consistent, and the description adds context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (~150 words) and well-structured with clear separation of modes, tokens, and constraints. Every sentence adds value, and there is no redundancy or fluff.

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

Completeness3/5

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

Covers main aspects of a payment tool but lacks details on return value format (no output schema) and error handling (e.g., what happens if payment succeeds but endpoint fails). Idempotency key is described in schema but not emphasized in description. Some gaps remain.

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 baseline is 3. The description adds some context (e.g., session_token overrides secret, token ignored when session_token, max_usd bounded by cap), but most parameter meaning is already clear from the schema.

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?

The description clearly states the tool calls a paid x402 endpoint, settles payment, and returns the result. It distinguishes itself from sibling tools (find_services, inspect_endpoint, x402_wallet) which are about finding, inspecting, or managing wallets, not executing paid calls.

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 description provides explicit guidance on when to use self-custodial vs session-governed modes, which token to pay with (USDC or $THREE), and mentions caps and confirmation. However, it does not explicitly compare to sibling tools or state when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nirholas/x402-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server