Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_get_asset_balance

Retrieve the current balance of a specific RGB asset by providing its asset ID for asset management and tracking purposes.

Instructions

Get balance for a specific RGB asset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetIdYesThe ID of the RGB asset

Implementation Reference

  • Handler function for the 'rgb_get_asset_balance' MCP tool. It calls rgbClient.getAssetBalance(assetId), stringifies the result as JSON, and handles errors.
    async ({ assetId }) => {
      try {
        const balance = await rgbClient.getAssetBalance(assetId);
        return { content: [{ type: 'text', text: JSON.stringify(balance, null, 2) }] };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
      }
    }
  • Zod schema defining the input parameters for the tool: a required 'assetId' string.
    {
      assetId: z.string().describe('The ID of the RGB asset'),
    },
  • src/server.ts:67-82 (registration)
    Registration of the 'rgb_get_asset_balance' tool on the MCP server using server.tool(), including description, input schema, and handler function.
    server.tool(
      'rgb_get_asset_balance',
      'Get balance for a specific RGB asset',
      {
        assetId: z.string().describe('The ID of the RGB asset'),
      },
      async ({ assetId }) => {
        try {
          const balance = await rgbClient.getAssetBalance(assetId);
          return { content: [{ type: 'text', text: JSON.stringify(balance, null, 2) }] };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
        }
      }
    );
  • Supporting method in RGBApiClientWrapper class that wraps the underlying RGB API SDK call to get the balance for a specific asset ID.
    async getAssetBalance(assetId: string) {
      return await this.client.rgb.getAssetBalance({ asset_id: assetId });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get balance' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns real-time vs cached data, or what format the balance comes in. This leaves significant behavioral gaps for a tool that presumably interacts with financial assets.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise - a single sentence that states exactly what the tool does without any unnecessary words. It's front-loaded with the core purpose and wastes no space on redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a financial balance tool with no annotations and no output schema, the description is insufficient. It doesn't explain what format the balance returns (numeric, string, structured object), what units it uses, whether it includes pending transactions, or any error conditions. Given the complexity of asset balance queries, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the single parameter 'assetId' clearly documented as 'The ID of the RGB asset.' The description doesn't add any additional parameter context beyond what the schema provides, so it meets the baseline for adequate but not exceptional parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get balance') and target resource ('for a specific RGB asset'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential alternatives like 'rgb_list_assets' or 'rgb_get_asset_metadata' which might provide related information, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, timing considerations, or how it differs from sibling tools like 'rgb_list_assets' or 'rgb_get_asset_metadata' that might provide related asset information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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