rgb_check_indexer_url
Validate indexer URL functionality to ensure proper connectivity for RGB asset operations on the Lightning Network.
Instructions
Check if an indexer URL is valid
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"indexerUrl": "<indexerUrl>"
},
"name": "rgb_check_indexer_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexerUrl | Yes | The indexer URL to check |
Implementation Reference
- src/server.ts:286-301 (registration)Registration of the 'rgb_check_indexer_url' tool, including input schema and inline handler function that calls the RGB client wrapper and formats the response.
server.tool( 'rgb_check_indexer_url', 'Check if an indexer URL is valid', { indexerUrl: z.string().describe('The indexer URL to check'), }, async ({ indexerUrl }) => { try { const result = await rgbClient.checkIndexerUrl(indexerUrl); 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:292-301 (handler)The handler function for the tool that executes the logic: calls rgbClient.checkIndexerUrl, serializes result to JSON, handles errors.
async ({ indexerUrl }) => { try { const result = await rgbClient.checkIndexerUrl(indexerUrl); 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:289-290 (schema)Input schema using Zod for validating the 'indexerUrl' parameter.
{ indexerUrl: z.string().describe('The indexer URL to check'), - src/rgb-client.ts:116-119 (helper)Helper method in RGBApiClientWrapper that wraps the underlying SDK call to node.checkIndexerUrl.
async checkIndexerUrl(indexerUrl: string) { return await this.client.node.checkIndexerUrl({ indexer_url: indexerUrl }); } }