rgb_pay_lightning_invoice
Process Lightning Network payments by submitting a BOLT11 invoice string. This tool enables settlement of Lightning invoices through the RGB Lightning Network MCP Server.
Instructions
Pay a Lightning Network invoice
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bolt11 | Yes | BOLT11 invoice string |
Implementation Reference
- src/server.ts:210-218 (handler)The MCP tool handler function that executes the payment of the Lightning invoice by calling the RGB API client wrapper's payInvoice method and formats the response or error.async ({ bolt11 }) => { try { const result = await rgbClient.payInvoice(bolt11); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } }
- src/server.ts:207-209 (schema)Zod input schema defining the bolt11 parameter for the tool.{ bolt11: z.string().describe('BOLT11 invoice string'), },
- src/server.ts:204-219 (registration)Registration of the rgb_pay_lightning_invoice tool on the MCP server, including name, description, schema, and inline handler.server.tool( 'rgb_pay_lightning_invoice', 'Pay a Lightning Network invoice', { bolt11: z.string().describe('BOLT11 invoice string'), }, async ({ bolt11 }) => { try { const result = await rgbClient.payInvoice(bolt11); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
- src/rgb-client.ts:89-91 (helper)Helper method in RGBApiClientWrapper that wraps the underlying SDK call to pay a Lightning invoice.async payInvoice(invoice: string) { return await this.client.lightning.payInvoice({ invoice }); }