Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_sdk_get_balance

Retrieve account balance from the Zetrix blockchain by providing a wallet address. This tool queries the network to display current token holdings for any Zetrix account.

Instructions

Get account balance using the official SDK

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Zetrix account address

Implementation Reference

  • Handler case for the zetrix_sdk_get_balance tool. It validates arguments, calls ZetrixSDK.getBalance with the provided address, and returns the formatted JSON response.
    case "zetrix_sdk_get_balance": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const balance = await zetrixSDK.getBalance(args.address as string);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(balance, null, 2),
          },
        ],
      };
    }
  • src/index.ts:428-441 (registration)
    Registration of the zetrix_sdk_get_balance tool in the tools array, defining its name, description, and input schema requiring an 'address' string.
    {
      name: "zetrix_sdk_get_balance",
      description: "Get account balance using the official SDK",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "The Zetrix account address",
          },
        },
        required: ["address"],
      },
    },
  • Core implementation of getBalance in ZetrixSDK class. Initializes the underlying zetrix-sdk-nodejs SDK and calls its account.getBalance method, handling errors and returning balance in micro units.
    async getBalance(address: string): Promise<ZetrixSDKBalance> {
      await this.initSDK();
    
      try {
        const result = await this.sdk.account.getBalance(address);
    
        if (result.errorCode !== 0) {
          throw new Error(result.errorDesc || `SDK Error: ${result.errorCode}`);
        }
    
        return {
          address,
          balance: result.result.balance,
        };
      } catch (error) {
        throw new Error(
          `Failed to get balance: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool reads balance data, implying it's a read-only operation, but doesn't mention potential side effects, authentication requirements, rate limits, or error handling. This is inadequate for a tool with no annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the balance output includes (e.g., currency, format), potential errors, or how it differs from sibling tools. For a read operation with no structured context, more detail is needed to guide effective use.

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 input schema has 100% description coverage, with the 'address' parameter fully documented. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage without compensating value.

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 account balance') and the method ('using the official SDK'), which distinguishes it from the sibling tool 'zetrix_get_balance' that likely uses a different method. However, it doesn't specify the exact resource beyond 'account balance', leaving some ambiguity about what type of balance is retrieved.

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 like 'zetrix_get_balance' or other account-related tools. It mentions the SDK method but doesn't explain why or when this is preferable, leaving the agent to guess based on the tool name alone.

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/Zetrix-Chain/zetrix-mcp-server'

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