lookup_invoice
Retrieve details for Lightning Network invoices using BOLT-11 strings or payment hashes to verify payment status and transaction information.
Instructions
Look up lightning invoice details from a BOLT-11 invoice or payment hash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payment_hash | No | The payment hash of the invoice to look up | |
| invoice | No | The BOLT 11 invoice to look up |
Implementation Reference
- src/tools/lookup_invoice.ts:19-32 (handler)The handler function for the 'lookup_invoice' tool. It calls client.lookupInvoice with the provided invoice or payment_hash and returns the result as a formatted JSON text content block.async (params) => { const result = await client.lookupInvoice({ invoice: params.invoice || undefined, payment_hash: params.payment_hash || undefined, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/tools/lookup_invoice.ts:12-18 (schema)Input schema definition for the 'lookup_invoice' tool using Zod schemas for optional payment_hash and invoice parameters.{ payment_hash: z .string() .describe("The payment hash of the invoice to look up") .nullish(), invoice: z.string().describe("The BOLT 11 invoice to look up").nullish(), },
- src/tools/lookup_invoice.ts:9-33 (registration)The server.tool call that registers the 'lookup_invoice' tool, including its name, description, input schema, and handler function.server.tool( "lookup_invoice", "Look up lightning invoice details from a BOLT-11 invoice or payment hash", { payment_hash: z .string() .describe("The payment hash of the invoice to look up") .nullish(), invoice: z.string().describe("The BOLT 11 invoice to look up").nullish(), }, async (params) => { const result = await client.lookupInvoice({ invoice: params.invoice || undefined, payment_hash: params.payment_hash || undefined, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } );
- src/mcp_server.ts:24-24 (registration)Invocation of registerLookupInvoiceTool during MCP server creation to register the 'lookup_invoice' tool.registerLookupInvoiceTool(server, client);