rgb_sign_message
Sign messages using the RGB node to verify authenticity and ownership of RGB assets on the Lightning Network.
Instructions
Sign a message with the RGB node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to sign |
Implementation Reference
- src/server.ts:269-284 (registration)Registration of the rgb_sign_message MCP tool, including input schema (message: string) and inline handler that delegates to rgbClient.signMessage() and handles response/error formatting.server.tool( 'rgb_sign_message', 'Sign a message with the RGB node', { message: z.string().describe('The message to sign'), }, async ({ message }) => { try { const result = await rgbClient.signMessage(message); 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:275-283 (handler)Inline handler function for the rgb_sign_message tool.async ({ message }) => { try { const result = await rgbClient.signMessage(message); 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:273-274 (schema)Zod input schema for the tool: message as string.message: z.string().describe('The message to sign'), },
- src/rgb-client.ts:111-113 (helper)Helper method in RGBApiClientWrapper that wraps the external SDK's node.signMessage method.async signMessage(message: string) { return await this.client.node.signMessage({ message }); }
- src/types.ts:101-104 (schema)TypeScript interface for the expected output of signMessage.export interface SignMessageResult { signature: string; [key: string]: any; }