Skip to main content
Glama

pay_l402_api

Make a request to a paid API. Supports L402 (Lightning) and X402 (USDC on Base) protocols. Platform fee on the API price: 1%, rounded down, minimum 1 sat, reported as fee in the response. 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.

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": "pay_l402_api"
  }
}

Input 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 observed

TDQS

A4.2/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 behavioral burden and does a good job: it discloses automatic payment on 402, protocol preference, the 1% platform fee with minimum 1 sat, and operator-key versus agent-key behavior. It does not describe failure behavior when max_payment_sats is exceeded or what the response looks like beyond the fee field.

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 action and then layers in protocol, fee, auto-payment, and key-mode details. Every sentence adds useful context without repetition.

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 payment-executing request tool with no annotations and no output schema, the description covers the critical behavior: automatic 402 handling, protocol preference, fee calculation, and key modes. It could be more complete about response passthrough and payment-limit failures, but the essential invocation context is present.

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 four parameters are already documented in the schema. The description adds payment context but does not add syntax or meaning beyond the schema for url, body, method, or max_payment_sats.

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?

States a specific verb and resource: make a request to a paid API. It also names the supported payment protocols and distinguishes the tool from discovery or invoice-specific siblings by focusing on executing the paid request.

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?

Explains the key usage context: if the API returns HTTP 402, it automatically detects and pays, preferring L402 when both protocols are available. It does not explicitly route agents to list_l402_apis for discovery or pay_invoice for non-API invoices, so it stops short of full alternative guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.