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
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The recipient Bitcoin address | |
| amount | Yes | The 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 }; } } );
- src/server.ts:170-173 (schema)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'), },
- src/server.ts:174-182 (handler)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 }; } }
- src/rgb-client.ts:77-79 (helper)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 }); }