@getalby/mcp
Version:
MCP server for controlling a Lightning wallet using Nostr Wallet Connect
32 lines (31 loc) • 1.25 kB
JavaScript
import { z } from "zod";
export function registerGetWalletServiceInfoTool(server, client) {
server.registerTool("get_wallet_service_info", {
title: "Get Wallet Service Info",
description: "Get NWC capabilities, supported encryption and notification types of the connected lightning wallet",
outputSchema: {
capabilities: z
.array(z.string())
.describe("Capabilities supported by this wallet - for example, NWC methods like 'pay_invoice', and 'notifications' if any notification types are supported."),
encryptions: z
.array(z.string())
.nullish()
.describe("NWC encryption types supported by this connection"),
notifications: z
.array(z.string())
.nullish()
.describe("NWC notification types supported by this connection"),
},
}, async () => {
const info = await client.getWalletServiceInfo();
return {
content: [
{
type: "text",
text: JSON.stringify(info, null, 2),
},
],
structuredContent: info,
};
});
}