Skip to main content
Glama

fetch_with_402_payment

Fetch a web API or resource and automatically settle Bitcoin HTTP 402 paywalls using Cashu NUT-24 (X-Cashu) or Lightning L402, with optional per-request satoshi limits.

Instructions

Fetch a web API or resource and automatically settle Bitcoin HTTP 402 paywalls via Cashu NUT-24 (X-Cashu) or Lightning L402.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "fetch_with_402_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesTarget HTTP/HTTPS URL to fetch (protected by SSRF Guard)
bodyNoOptional request body string (for POST requests)
methodNoHTTP method to use (default: GET)
preferRailNoPreferred settlement rail when both headers are offered (default: cashu)
maxAutoPaySatsNoOptional per-request ceiling in satoshis for automatic 402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the most important trait — that payment is settled automatically — but leaves out failure behavior when no rail is offered, whether spending is bounded by maxAutoPaySats, and what happens to the fetched content after payment.

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?

A single front-loaded sentence with no wasted words; the automatic-settlement behavior is stated up front. The protocol jargon (NUT-24, X-Cashu, L402) is dense but earns its place by naming the rails.

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?

With five parameters, no annotations, and no output schema, the definition is thin for a tool that spends money. It covers the core mechanism but omits return-value expectations, payment-failure handling, and the safety implications of automatic settlement.

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 all five parameters are already documented in the schema. The description echoes the two rail names (cashu/l402) but adds no syntax, defaults, or interaction details beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (fetch) and resource (web API or resource) and states the distinctive behavior: automatic settlement of HTTP 402 paywalls via Cashu NUT-24 or Lightning L402. It is clear what the tool does, though it does not explicitly contrast itself with payment siblings such as pay_lightning_nwc or pay_cashu_nutzap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: use this when fetching a URL that may be behind a 402 paywall. There is no explicit when-not guidance, no statement of prerequisites (e.g., funded wallet), and no routing to alternatives for plain unpaid fetches or direct payments.

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