Skip to main content
Glama

lookup_invoice

Retrieve detailed information about a Lightning Network invoice using a BOLT-11 invoice string or payment hash. Facilitates invoice verification and payment tracking within the NWC MCP Server environment.

Instructions

Look up lightning invoice details from a BOLT-11 invoice or payment hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceNoThe BOLT 11 invoice to look up
payment_hashNoThe payment hash of the invoice to look up

Implementation Reference

  • The handler function executes the tool logic by calling the NWC client's lookupInvoice method with the provided invoice or payment_hash parameters and returns the result as a formatted JSON text response.
    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), }, ], }; }
  • Zod schema defining the input parameters for the lookup_invoice tool: optional payment_hash (string) and invoice (BOLT11 string).
    { 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(), },
  • The server.tool call within registerLookupInvoiceTool that registers the lookup_invoice tool, including name, description, input schema, and handler on the MCP server.
    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), }, ], }; } );
  • Invocation of the registerLookupInvoiceTool function during MCP server creation to enable the lookup_invoice tool.
    registerLookupInvoiceTool(server, client);

Other Tools

Related 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/getAlby/nwc-mcp-server'

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