get_balance
Retrieve the current balance from a connected Bitcoin Lightning wallet to monitor available funds for transactions.
Instructions
Get the balance of the connected lightning wallet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get_balance.ts:11-21 (handler)Async handler function that executes the get_balance tool: fetches wallet balance using NWC client and returns it formatted as JSON text.async () => { const balance = await client.getBalance(); return { content: [ { type: "text", text: JSON.stringify(balance, null, 2), }, ], }; }
- src/tools/get_balance.ts:4-23 (registration)Registers the get_balance tool on the MCP server using server.tool(), including the tool name, description, and handler function.export function registerGetBalanceTool( server: McpServer, client: nwc.NWCClient ) { server.tool( "get_balance", "Get the balance of the connected lightning wallet", async () => { const balance = await client.getBalance(); return { content: [ { type: "text", text: JSON.stringify(balance, null, 2), }, ], }; } ); }
- src/mcp_server.ts:23-23 (registration)Calls registerGetBalanceTool to register the get_balance tool during MCP server creation.registerGetBalanceTool(server, client);