@getalby/mcp
Version:
MCP server for controlling a Lightning wallet using Nostr Wallet Connect
22 lines (21 loc) • 662 B
JavaScript
import { z } from "zod";
export function registerGetBalanceTool(server, client) {
server.registerTool("get_balance", {
title: "Get Balance",
description: "Get the balance of the connected lightning wallet",
outputSchema: {
balance: z.number().describe("Current wallet balance in millisats"),
},
}, async () => {
const balance = await client.getBalance();
return {
structuredContent: balance,
content: [
{
type: "text",
text: JSON.stringify(balance, null, 2),
},
],
};
});
}