Skip to main content
Glama

pay_invoice

Pay BOLT11 Lightning invoices and receive the preimage as proof. If payment is pending, don't retry; check transaction status instead.

Instructions

Pay a BOLT11 Lightning invoice. Returns the preimage as proof of payment. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key. If the response says pending:true the payment is still in flight: do NOT retry, check get_transactions instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bolt11YesBOLT11 invoice string to pay (starts with lnbc...)
max_fee_satsNoMaximum routing fee in satoshis (backend default: 100 for agent keys, 10 for operator keys; unused reserve is refunded)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.1
    • changedInput schema / properties / max_fee_sats / description
      Previous value: -"Maximum routing fee in satoshis"New value: +"Maximum routing fee in satoshis (backend default: 100 for agent keys, 10 for operator keys; unused reserve is refunded)"
  2. First observedv1.2.9

TDQS

A4/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 burden. It discloses the return value (preimage), the pending/in-flight behavior with a clear 'do NOT retry' directive, and the two key modes (operator and agent). These are important behavioral traits. It does not cover idempotency, error cases, or authentication prerequisites, but the core safety-critical behavior is well covered.

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 concise sentences, each earning its place: the core purpose, the key types, and the critical pending behavior. It is front-loaded with the main action and avoids any filler or repetition. This is exemplary structure.

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 2 well-documented parameters and no output schema, the description covers the essential aspects: purpose, return, key handling, and the most important behavioral caveat (pending). It does not delve into failure modes or setup requirements, but given the simplicity and the schema coverage, it is adequately complete for an agent to invoke correctly.

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 bolt11 and max_fee_sats in detail. The description does not add extra meaning to these parameters—it only mentions the invoice type implicitly. Baseline 3 is appropriate since the schema handles the semantics, and the description adds no further clarification.

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 opens with 'Pay a BOLT11 Lightning invoice' — a specific verb and resource that clearly identifies the tool's function. It also notes the return of a preimage as proof, adding useful context. While it doesn't explicitly name sibling tools like pay_lightning_address or keysend, the BOLT11 focus inherently differentiates it, so it's clear but not exhaustive.

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 provides actionable guidance: it explains the two key types (operator vs agent) and, critically, instructs that if pending:true is returned, the agent must NOT retry and should instead check get_transactions. This is an explicit conditional alternative, which is strong usage guidance, even though it doesn't compare against other payment tools directly.

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