Skip to main content
Glama

pay_x402

Pay the quoted price for an HTTP resource using the x402 protocol, with spend policy and audit enforcement.

Instructions

Fetch a paid HTTP resource, paying for it over the x402 protocol ("402 Payment Required"). Use this for pay-per-request APIs that quote a price in the 402 response; the spend policy decides whether the quoted price is allowed, blocked, or requires human approval.

The payment is a signed one-time authorization for EXACTLY the quoted amount — never more — and it only happens if the quote passes policy.

Args: url: the resource to fetch (https) max_amount: the most you expect this to cost, in whole token units (e.g. 0.01 for 1 cent of USDC). If the server demands more, the request is refused before policy even runs. reason: what the purchase is for (recorded in the audit log)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
reasonNo
max_amountYes
Behavior4/5

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

Without annotations, the description discloses key behaviors: payment is a signed one-time authorization for exactly the quoted amount, never more, and only proceeds if policy passes. It does not detail side effects or error responses, but the core behavior is well explained.

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?

The description is front-loaded with the core purpose and protocol, followed by parameter details. It is moderately concise; every sentence adds value, though some minor redundancy exists (e.g., repeating the policy check).

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?

The tool has 3 parameters and no output schema. The description covers the function and parameters adequately but omits return value details and error handling (e.g., what the response contains or failure cases). It meets basic needs but leaves some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully explains each parameter: url as the resource, max_amount in whole token units with an example (0.01 for 1 cent of USDC), and reason for audit logging. This adds significant meaning beyond the bare 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 explicitly states 'Fetch a paid HTTP resource, paying for it over the x402 protocol.' It clearly identifies the tool's purpose and distinguishes it from siblings by specifying it's for pay-per-request APIs with price quotes.

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 advises using this tool for APIs that quote a price in a 402 response and notes the spend policy decision. It implies limitations (max_amount blocks before policy) but does not explicitly compare to sibling tools like request_payment or get_balance.

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/Theoddalex/agentmandate'

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