Skip to main content
Glama

pay_l402_api

Make HTTP requests to paid APIs and automatically handle L402 or X402 payments when a 402 response requires it.

Instructions

Make a request to a paid API. Supports L402 (Lightning) and X402 (USDC on Base) protocols. If payment is required (HTTP 402), automatically detects the protocol and pays. L402 is preferred when both are available. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to request
bodyNoRequest body for POST/PUT requests
methodNoHTTP methodGET
max_payment_satsNoMaximum amount in satoshis to pay for this request

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.9

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full transparency burden. It discloses key behaviors: automatic protocol detection and payment, L402 preference, and support for both operator and agent keys. It does not mention failure modes, irreversibility of payments, or budget/wallet impacts beyond 'pays', but the core spend behavior is clearly stated.

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 three sentences with no filler. The main purpose is front-loaded, followed by protocol behavior and key-mode details. Every sentence contributes operational information, and there is no repetition of schema content.

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?

For a tool that automatically spends funds, the description is useful but not fully complete. It explains the protocol handling and key modes, but not the response format, error behavior when payment fails, how the caller selects between operator and agent keys, or authentication prerequisites. Given moderate complexity and no output schema, there are clear gaps an agent must resolve elsewhere.

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 baseline is 3. The description does not add much parameter-specific meaning beyond the schema: it mentions operator/agent key modes, but does not tie these to any parameter or explain how they affect the call. The schema already documents url, body, method, and max_payment_sats adequately.

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 verb and resource: 'Make a request to a paid API.' It then names the supported protocols (L402, X402) and the core automatic payment behavior. This clearly differentiates it from siblings like pay_invoice or keysend, which pay invoices/lightning addresses rather than API requests.

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 gives clear context: it is used for paid APIs where HTTP 402 may occur, and it automatically detects and pays the required protocol. It also states that L402 is preferred when both protocols are available. It does not explicitly name alternative tools or exclusion cases, so it misses the 'when-not-to-use' component.

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