Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_decode_lightning_invoice

Decode RGB Lightning invoices to extract payment details and transaction information for RGB asset transfers on the Lightning Network.

Instructions

Decode an RGB Lightning invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesThe RGB Lightning invoice to decode

Implementation Reference

  • src/server.ts:303-318 (registration)
    Registers the 'rgb_decode_lightning_invoice' MCP tool with input schema, description, and inline handler function that calls the RGB client wrapper.
    server.tool( 'rgb_decode_lightning_invoice', 'Decode an RGB Lightning invoice', { invoice: z.string().describe('The RGB Lightning invoice to decode'), }, async ({ invoice }) => { try { const result = await rgbClient.decodeRGBLNInvoice(invoice); 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 }; } } );
  • The inline MCP tool handler executing the decoding logic via rgbClient and formatting the response as MCP content.
    async ({ invoice }) => { try { const result = await rgbClient.decodeRGBLNInvoice(invoice); 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 }; } }
  • Zod input schema defining the 'invoice' parameter for the tool.
    { invoice: z.string().describe('The RGB Lightning invoice to decode'),
  • Helper wrapper method in RGBApiClientWrapper that proxies the decode call to the underlying RGB API SDK lightning module.
    async decodeRGBLNInvoice(invoice: string) { return await this.client.lightning.decodeRGBLNInvoice(invoice); }

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/lnfi-network/rgb-mcp-server'

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