Skip to main content
Glama

get_invoice_status

Check payment status of Bitcoin Lightning invoices using payment hash to verify if transactions are complete.

Instructions

Check if a created invoice has been paid. Use the payment_hash from create_invoice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payment_hashYesPayment hash of the invoice to check

Implementation Reference

  • The tool handler for get_invoice_status in the MCP server request handler.
    case 'get_invoice_status': {
      const parsed = GetInvoiceStatusSchema.parse(args);
      const result = await session.requireClient().getInvoiceStatus(parsed.payment_hash);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              paid: result.paid,
              amount_sats: result.amountSats,
              settled_at: result.settledAt,
              preimage: result.preimage,
              expired: result.expired,
              new_balance: result.newBalance,
            }, null, 2),
          },
        ],
      };
    }
  • The client-side implementation of getInvoiceStatus which sends the request to the backend.
    async getInvoiceStatus(paymentHash: string): Promise<{
      paid: boolean;
      amountSats: number;
      settledAt?: string;
      preimage?: string;
      expired: boolean;
      newBalance?: number;
      rawResponse: InvoiceStatusResponse;
    }> {
      const result = await this.request<InvoiceStatusResponse>('get_invoice_status', {
        payment_hash: paymentHash,
      });
    
      const paid = result.paid || result.settled || result.status === 'settled';
    
      return {
        paid,
        amountSats: result.amount_sats || 0,
        settledAt: result.settled_at,
        preimage: result.preimage,
        expired: result.expired || false,
        newBalance: result.new_balance,
        rawResponse: result,
      };
  • Input validation schema for the get_invoice_status tool.
    const GetInvoiceStatusSchema = z.object({
      payment_hash: z.string().describe('Payment hash of the invoice to check'),
    });
Behavior3/5

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

With no annotations provided, the description carries the full burden. It indicates this is a read operation (checking status) but doesn't disclose behavioral aspects like rate limits, authentication requirements, error conditions, or what specific status values might be returned. It adds basic context about the payment_hash source but lacks operational details.

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?

Two sentences with zero waste: the first states the purpose, the second provides crucial usage guidance. Every word earns its place, and information is front-loaded with the core function stated immediately.

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 single-parameter read tool with no output schema, the description is minimally complete—it explains what the tool does and how to use it. However, it lacks details about return values (e.g., paid/unpaid status, timestamps) and error handling, which would be helpful given the absence of annotations and output schema.

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 fully documents the single parameter. The description adds marginal value by mentioning the payment_hash comes 'from create_invoice,' providing context about parameter sourcing but not additional semantic meaning beyond what the schema provides.

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 clearly states the specific action ('Check if a created invoice has been paid') and identifies the resource ('invoice'), with the payment_hash parameter providing precise targeting. It distinguishes from siblings like 'create_invoice' by focusing on status verification rather than creation.

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

Usage Guidelines5/5

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

Explicit guidance is provided on when to use this tool ('Check if a created invoice has been paid') and the prerequisite ('Use the payment_hash from create_invoice'), clearly differentiating it from alternatives like 'get_transactions' or 'check_balance' that serve different purposes.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lightningfaucet/lightning-wallet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server