Skip to main content
Glama
Theoddalex

imprest

by Theoddalex

pay_x402

Fetch a paid HTTP resource by paying the exact amount quoted in a 402 response, subject to spend policy approval.

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?

The description details that the payment is a signed one-time authorization for the exact quoted amount, only executed if policy approves. It also explains the max_amount parameter sets a cap. With no annotations, this provides good behavioral insight, though it omits what happens on failure or balance deduction.

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 well-structured with a clear introductory paragraph and an Args list. Every sentence provides necessary information without redundancy.

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?

For a tool with no output schema, annotations, or complex nested objects, the description adequately covers the protocol, policy interaction, and parameters. Minor gap: no mention of return value or error handling.

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?

All three parameters (url, max_amount, reason) are explained with their purpose, format, and behavior. This adds significant meaning beyond the bare schema, which lacks descriptions.

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 fetches a paid HTTP resource via the x402 protocol. It specifies the use case for pay-per-request APIs, differentiating it from sibling tools that handle payments or approvals differently.

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 explains when to use this tool (pay-per-request APIs with 402 responses) and mentions the spend policy. However, it does not explicitly exclude other scenarios or compare with siblings like request_payment.

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/agentpay'

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