Skip to main content
Glama

l402-fetch

Destructive

Fetch a payment-gated URL, automatically handling L402 and x402 payments. Pay within budget, retry on failure, or return payment details for manual approval.

Instructions

Fetch a URL with automatic payment handling (L402 Lightning + x402 on-chain + ecash and LUD-25 bearer notes). Manages credentials, pays automatically when autoPay is true and cost is within budget, and retries. For human wallets, returns a payment page URL or QR code. For x402 services, returns payment details (receiver address, network, asset, amount) — the user pays in their wallet and provides the transaction hash. Set autoPay to true for seamless access. When a 402 is returned with tiers, present the pricing options to the user and use l402-buy-credits to purchase their chosen tier. For widget hosts, call l402-fetch-preview first to show a payment confirmation dialog before spending.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe primary URL to request. When using search results, pass the first URL here and all URLs in the urls field.
bodyNoRequest body (for POST/PUT)
urlsNoAll transport URLs from l402-search results (clearnet, onion, HNS). When present, transports are tried in preference order with automatic fallback on connection failure.
methodNoHTTP methodGET
pubkeyNoService pubkey from l402-search results — used to share credentials across all transport URLs for the same service
txHashNoTransaction hash from a completed x402 on-chain payment. When provided, retries the request with X-Payment header for server verification.
autoPayNoAutomatically pay if within MAX_AUTO_PAY_SATS budget
headersNoAdditional request headers
Install Server

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only signal openWorldHint and destructiveHint; the description carries the burden and does so well. It discloses that the tool manages credentials, pays automatically when autoPay is true and cost is within budget, retries, and returns different payment artifacts depending on wallet type. This goes far beyond the generic annotations and warns of spending behavior without contradicting them.

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 dense and front-loaded, with each sentence contributing to core behavior or routing. It is longer than strictly necessary—'Set autoPay to true for seamless access' partly repeats the schema—but the extra scenario-based guidance is earned rather than filler.

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 complex, spend-capable tool with no output schema, the description covers the high-risk and non-obvious payment paths: automatic payment, human-wallet returns, x402 verification via txHash, tier handling, and preview flow. It does not explicitly describe the normal successful fetch response body or exact retry/budget limits, but it provides enough context for correct invocation in the main scenarios.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the behavioral effect of autoPay (automatic payment within budget), txHash (replays the request with X-Payment header), and how responses differ for human wallets vs x402 services. It does not add much for url, body, method, headers, or pubkey, but those are already well-described in 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 opens with a specific action: 'Fetch a URL with automatic payment handling' and enumerates the supported payment protocols (L402 Lightning, x402 on-chain, ecash and LUD-25). It also differentiates itself from siblings by routing tiered payments to l402-buy-credits and widget-host flows to l402-fetch-preview, so an agent can distinguish it without opening other tool definitions.

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 gives explicit if-then usage guidance: when a 402 response includes tiers, present pricing and use l402-buy-credits; widget hosts should call l402-fetch-preview first. It also explains when autoPay should be true and distinguishes human-wallet flows from x402 flows, which is strong practical routing guidance.

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

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/forgesworn/402-mcp'

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