rgb_get_network_info
Retrieve network status and configuration details from the RGB Lightning Node to monitor connectivity and operational parameters.
Instructions
Get network information from the RGB node
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "rgb_get_network_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:152-165 (registration)Registration of the 'rgb_get_network_info' MCP tool, including description, empty input schema, and inline handler that calls the RGB client's getNetworkInfo method and returns formatted JSON or error.
server.tool( 'rgb_get_network_info', 'Get network information from the RGB node', {}, async ({}) => { try { const networkInfo = await rgbClient.getNetworkInfo(); return { content: [{ type: 'text', text: JSON.stringify(networkInfo, 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:152-165 (handler)The inline handler function executes the tool logic by fetching network information via rgbClient and responding with JSON.
server.tool( 'rgb_get_network_info', 'Get network information from the RGB node', {}, async ({}) => { try { const networkInfo = await rgbClient.getNetworkInfo(); return { content: [{ type: 'text', text: JSON.stringify(networkInfo, 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:40-42 (helper)Helper method in RGBApiClientWrapper that wraps the SDK call to retrieve network information from the RGB node.
async getNetworkInfo() { return await this.client.node.getNetworkInfo(); }