Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

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
NameRequiredDescriptionDefault
assetIdYesThe 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.getAssetMetadata
    server.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 };
        }
      }
    );
  • Inline handler function for the rgb_get_asset_metadata tool that fetches asset metadata via the RGB client and formats the response as MCP content
    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 };
      }
    }
  • Zod-based input schema defining the required 'assetId' parameter as a string
    {
      assetId: z.string().describe('The ID of the RGB asset'),
  • Helper method in RGBApiClientWrapper that wraps the underlying SDK call to retrieve RGB asset metadata, transforming assetId to asset_id
    async getAssetMetadata(assetId: string) {
      return await this.client.rgb.getAssetMetadata({ asset_id: assetId });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lnfi-network/rgb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server