Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_send_bitcoin

Send Bitcoin to a specified address using the RGB Lightning Network MCP Server. This tool processes on-chain Bitcoin transactions by accepting a recipient address and amount in satoshis.

Instructions

Send Bitcoin to an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe recipient Bitcoin address
amountYesThe amount to send in satoshis

Implementation Reference

  • src/server.ts:167-183 (registration)
    Registration of the 'rgb_send_bitcoin' MCP tool, including input schema and handler function that delegates to RGBApiClientWrapper.sendBitcoin(address, amount) method.
    server.tool(
      'rgb_send_bitcoin',
      'Send Bitcoin to an address',
      {
        address: z.string().describe('The recipient Bitcoin address'),
        amount: z.number().describe('The amount to send in satoshis'),
      },
      async ({ address, amount }) => {
        try {
          const result = await rgbClient.sendBitcoin(address, amount);
          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 };
        }
      }
    );
  • Input schema for the rgb_send_bitcoin tool using Zod validation.
    {
      address: z.string().describe('The recipient Bitcoin address'),
      amount: z.number().describe('The amount to send in satoshis'),
    },
  • Handler function that executes the tool logic by calling the client wrapper's sendBitcoin method.
    async ({ address, amount }) => {
      try {
        const result = await rgbClient.sendBitcoin(address, amount);
        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 };
      }
    }
  • Helper method in RGBApiClientWrapper that wraps the underlying SDK's onchain.sendBtc call for sending Bitcoin.
    async sendBitcoin(address: string, amount: number) {
      return await this.client.onchain.sendBtc({ address, amount });
    }

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