rgb_list_assets
Retrieve a complete list of all RGB assets currently available in your RGB Lightning node for asset management and tracking purposes.
Instructions
List all RGB assets available in the node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:55-64 (handler)MCP tool handler function for 'rgb_list_assets' that invokes rgbClient.listAssets with empty filter and returns the JSON-formatted result or error response.async ({}) => { try { // Pass the correct filter object structure expected by the API const assets = await rgbClient.listAssets({ filter_asset_schemas: [] }); return { content: [{ type: 'text', text: JSON.stringify(assets, 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:51-65 (registration)Registers the 'rgb_list_assets' MCP tool with empty input schema and inline handler.server.tool( 'rgb_list_assets', 'List all RGB assets available in the node', {}, async ({}) => { try { // Pass the correct filter object structure expected by the API const assets = await rgbClient.listAssets({ filter_asset_schemas: [] }); return { content: [{ type: 'text', text: JSON.stringify(assets, 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:45-54 (helper)Helper method in RGBApiClientWrapper that wraps the SDK's listAssets call, ensuring the filter object has 'filter_asset_schemas' field.async listAssets(filter?: any) { // The API expects an object with filter_asset_schemas field // If filter is provided and is a proper object with filter_asset_schemas, use it // Otherwise, default to empty filter if (filter && typeof filter === 'object' && 'filter_asset_schemas' in filter) { return await this.client.rgb.listAssets(filter); } else { return await this.client.rgb.listAssets({ filter_asset_schemas: [] }); } }