Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_list_swaps

Lists available RGB asset swaps to help users identify trading opportunities between different digital assets on the Lightning Network.

Instructions

List available swaps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for 'rgb_list_swaps'. It calls rgbClient.listSwaps() to fetch swaps and returns a JSON-formatted text response or an error message.
    try { const swaps = await rgbClient.listSwaps(); return { content: [{ type: 'text', text: JSON.stringify(swaps, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
  • src/server.ts:238-250 (registration)
    Registration of the 'rgb_list_swaps' MCP tool using server.tool, including empty input schema and inline handler.
    'rgb_list_swaps', 'List available swaps', {}, async ({}) => { try { const swaps = await rgbClient.listSwaps(); return { content: [{ type: 'text', text: JSON.stringify(swaps, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
  • Helper method in RGBApiClientWrapper that proxies the listSwaps call to the underlying SDK client.
    async listSwaps() { return await this.client.swaps.listSwaps();

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/lnfi-network/rgb-mcp-server'

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