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
| Name | Required | Description | Default |
|---|---|---|---|
| payment_hash | Yes | Payment hash of the invoice to check |
Implementation Reference
- src/index.ts:954-973 (handler)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), }, ], }; } - src/lightning-faucet.ts:337-360 (handler)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, }; - src/index.ts:115-117 (schema)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'), });