Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_send_assets

Send RGB assets to multiple recipients by specifying asset IDs and corresponding recipient addresses with amounts. This tool facilitates asset transfers within the RGB Lightning Network ecosystem.

Instructions

Send RGB assets to recipients

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipientMapYesMap of asset IDs to recipient/amount pairs

Implementation Reference

  • src/server.ts:84-102 (registration)
    Registration of the 'rgb_send_assets' MCP tool, including input schema (recipientMap as record of assetId to array of recipient/amount objects) and handler function that delegates to rgbClient.sendAssets()
    server.tool( 'rgb_send_assets', 'Send RGB assets to recipients', { recipientMap: z.record(z.string(), z.array(z.object({ recipient: z.string().describe('The recipient address'), amount: z.number().describe('The amount to send'), }))).describe('Map of asset IDs to recipient/amount pairs'), }, async ({ recipientMap }) => { try { const result = await rgbClient.sendAssets(recipientMap); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
  • MCP tool handler: receives recipientMap, calls rgbClient.sendAssets(recipientMap), returns JSON stringified result or error
    async ({ recipientMap }) => { try { const result = await rgbClient.sendAssets(recipientMap); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } }
  • Zod input schema for recipientMap: object mapping asset IDs (string) to arrays of {recipient: string, amount: number}
    { recipientMap: z.record(z.string(), z.array(z.object({ recipient: z.string().describe('The recipient address'), amount: z.number().describe('The amount to send'), }))).describe('Map of asset IDs to recipient/amount pairs'), },
  • Wrapper method in RGBApiClientWrapper: forwards recipientMap to underlying SDK's rgb.sendAssets with {recipient_map}
    async sendAssets(recipientMap: any) { return await this.client.rgb.sendAssets({ recipient_map: recipientMap }); }
  • TypeScript interface defining the structure of SendAssetsParams matching the tool input schema
    export interface SendAssetsParams { recipient_map: { [assetId: string]: Array<{ recipient: string; amount: number; }>; }; }

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