Skip to main content
Glama

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)}` ); } }

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