Skip to main content
Glama

l402-pay

Destructive

Pay L402 challenges from l402-fetch or l402-discover via payment hash, store the credential for next l402-fetch, and poll human wallet settlement up to 120s.

Instructions

Pay a challenge that l402-fetch or l402-discover returned, by its paymentHash, and store the credential so the next l402-fetch succeeds. For human wallets, polls the payment page for settlement for up to 120s; call it straight after showing the payment URL to the user. An invoice that did not come from such a challenge is paid only if the human approves it in the client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoPayment method override. Defaults to wallet priority: NWC > Cashu > LNURLcash > human.
invoiceNoBOLT-11 invoice. Leave out when paying a challenge by paymentHash; any other invoice needs the human to approve it.
macaroonNoMacaroon from the L402 challenge. Optional if paymentHash matches a cached challenge.
paymentHashNoPayment hash of a challenge from l402-fetch or l402-discover.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.3.0
    • changedInput schema / properties / invoice / description
      Previous value: -"BOLT-11 invoice to pay. Optional if paymentHash matches a cached challenge from l402-discover."New value: +"BOLT-11 invoice. Leave out when paying a challenge by paymentHash; any other invoice needs the human to approve it."
    • changedInput schema / properties / paymentHash / description
      Previous value: -"Payment hash to look up cached challenge from l402-discover."New value: +"Payment hash of a challenge from l402-fetch or l402-discover."
  2. First observedv4.2.1

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already flag destructiveHint and openWorldHint, but the description adds substantial behavioral detail: it stores credentials for the next fetch, polls the payment page for up to 120s for human wallets, and requires human approval for unrelated invoices. No contradiction with annotations.

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?

Three dense, purposeful sentences: the core action and effect come first, followed by the human-wallet polling behavior and timing, then the approval condition. There is no filler or redundant restating of schema content.

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 tool with no output schema, the description provides rich context: source of the challenge, credential storage, polling window, and human approval rule. The only minor gap is that it does not state what the caller receives on success, failure, or timeout.

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 four parameters, including the paymentHash/invoice relationship and the human-approval caveat. The description reinforces these ideas but adds no new parameter-level format or constraint details beyond 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 concrete verb-object pair: 'Pay a challenge ... by its paymentHash.' It names the exact source tools (l402-fetch or l402-discover), making it clearly distinct from payment-adjacent siblings like l402-buy-credits or l402-redeem-cashu.

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 timing guidance ('call it straight after showing the payment URL') and restricts automatic payment to challenges from l402-fetch or l402-discover. It does not explicitly list when to prefer an alternative payment sibling, so it falls just short of full routing guidance.

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