rgb_get_asset_metadata
Retrieve detailed metadata for a specific RGB asset by providing its unique asset ID, enabling access to essential asset information through the RGB Lightning Network MCP Server.
Instructions
Get metadata for a specific RGB asset
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetId | Yes | The ID of the RGB asset |
Implementation Reference
- src/server.ts:104-119 (registration)Registration of the 'rgb_get_asset_metadata' MCP tool, including input schema, description, and inline handler function that delegates to RGBApiClientWrapper.getAssetMetadataserver.tool( 'rgb_get_asset_metadata', 'Get metadata for a specific RGB asset', { assetId: z.string().describe('The ID of the RGB asset'), }, async ({ assetId }) => { try { const metadata = await rgbClient.getAssetMetadata(assetId); return { content: [{ type: 'text', text: JSON.stringify(metadata, 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:110-118 (handler)Inline handler function for the rgb_get_asset_metadata tool that fetches asset metadata via the RGB client and formats the response as MCP contentasync ({ assetId }) => { try { const metadata = await rgbClient.getAssetMetadata(assetId); return { content: [{ type: 'text', text: JSON.stringify(metadata, 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:107-108 (schema)Zod-based input schema defining the required 'assetId' parameter as a string{ assetId: z.string().describe('The ID of the RGB asset'),
- src/rgb-client.ts:60-62 (helper)Helper method in RGBApiClientWrapper that wraps the underlying SDK call to retrieve RGB asset metadata, transforming assetId to asset_idasync getAssetMetadata(assetId: string) { return await this.client.rgb.getAssetMetadata({ asset_id: assetId }); }