Skip to main content
Glama

pay_x402

Process HTTP requests requiring payment by automatically handling x402 payment flows: fetches URLs, detects payment requirements, executes on-chain payments, and retries with proof of payment.

Instructions

Handle an x402 payment flow. Fetches a URL, and if the server returns HTTP 402 Payment Required, parses the payment requirements, executes the on-chain payment, and retries the request with proof of payment. Returns the final response. Supports the x402 open payment standard (https://x402.org). Set max_payment to prevent overspending.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to access (will handle 402 payment if required)
wallet_idYesWallet ID to pay from
methodNoHTTP method (GET, POST, PUT, DELETE)GET
headersNoOptional JSON string of additional request headers
bodyNoOptional request body for POST/PUT requests
max_paymentNoMaximum payment in human-readable format (e.g. "1.00" for 1 USDC). Rejects payments above this amount. Strongly recommended to prevent overspending.
prefer_chainNoPreferred chain ID if the server accepts payment on multiple chains (e.g. 8453 for Base, 1 for Ethereum)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's multi-step behavior (fetching, parsing payment requirements, executing payment, retrying) and includes important operational details like supporting the x402 standard and the max_payment safety feature. It lacks specifics on error handling or rate limits, but covers core behavioral traits well.

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 appropriately sized and front-loaded, starting with the core purpose and flow, then adding supporting details (standard reference, max_payment tip). Every sentence earns its place by contributing essential information without redundancy or fluff.

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?

Given the tool's complexity (multi-step payment flow) and no annotations or output schema, the description does a good job explaining what the tool does and key considerations like max_payment. It could be more complete by detailing the return format or error cases, but it provides sufficient context for an agent to understand and invoke the tool effectively.

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 all parameters thoroughly. The description adds some context by mentioning max_payment prevents overspending and referencing the x402 standard, but does not provide significant additional semantic meaning beyond what the schema descriptions offer. This meets the baseline for high schema coverage.

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's purpose with specific verbs ('fetches', 'parses', 'executes', 'retries', 'returns') and resources ('URL', 'payment requirements', 'on-chain payment', 'final response'). It distinguishes from siblings by focusing on the x402 payment flow, unlike wallet management or token operations in sibling tools.

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 clear context for when to use this tool: for handling x402 payment flows when accessing URLs that may require payment. It mentions setting max_payment to prevent overspending, which is a practical guideline. However, it does not explicitly state when not to use it or name alternatives among siblings.

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/hifriendbot/agentwallet-mcp'

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