Skip to main content
Glama

generate_x402_challenge

Generate HTTP 402 Payment Required responses to gate resources with on-chain crypto payments. Creates payment challenges for Algorand, VOI, Hedera, and Stellar networks.

Instructions

Generate an x402 (spec v1) 402 Payment Required response for gating a resource. Returns the X-Payment-Required header value and full payload. The client must pay on-chain and re-send with X-Payment: , then verify with verify_x402_proof.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceYesResource URL or identifier being gated.
amount_microunitsYesAmount in asset micro-units (1 USDC = 1_000_000).
networkNoNetwork to accept. Defaults to algorand_mainnet.
expires_in_secondsNoChallenge TTL in seconds; default 300.
descriptionNoOptional human-readable description shown in the payment prompt.
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool generates a response and returns specific outputs (header value and payload), but lacks details on rate limits, authentication needs, error handling, or what happens if parameters are invalid. It adds some context about the payment workflow but misses behavioral traits like performance or side effects.

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 front-loaded with the core purpose in the first sentence, followed by essential usage steps. Every sentence earns its place by explaining the tool's function and the subsequent workflow without redundancy, making it efficient and well-structured.

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 no annotations and no output schema, the description adequately covers the tool's purpose and usage in context. It explains the return values (header and payload) and ties into sibling tools, but could be more complete by detailing error cases or output format specifics, which are missing from structured fields.

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 (e.g., resource as URL/identifier, amount_microunits with USDC example, network with enum and default). The description does not add meaning beyond the schema, such as explaining parameter interactions or use cases, so it meets the baseline for high 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 generates an x402 Payment Required response for gating a resource, specifying it returns header value and full payload. It distinguishes from siblings like verify_x402_proof by focusing on generation rather than verification, and uses specific technical terms (e.g., 'spec v1', 'X-Payment-Required header').

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?

The description explicitly states when to use this tool ('for gating a resource') and provides clear alternatives: after generation, the client must pay and re-send with X-Payment header, then verify with verify_x402_proof. This gives a complete workflow context, distinguishing it from sibling tools like create_payment_link or verify_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/chopmob-cloud/AlgoVoi-Platform-Adapters'

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