Skip to main content
Glama

zetrix_get_account

Retrieve Zetrix blockchain account details such as balance and metadata by providing the account address.

Instructions

Get Zetrix account information including balance and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Zetrix account address

Implementation Reference

  • Core handler function that executes the tool logic: makes HTTP GET request to Zetrix RPC /getAccount endpoint, handles errors, and returns formatted account data (balance, nonce, metadata).
    async getAccount(address: string): Promise<ZetrixAccount> { try { const response = await this.client.get("/getAccount", { params: { address }, }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } const account = response.data.result; return { address: account.address || address, balance: account.balance || "0", nonce: account.nonce || 0, metadata: account.metadatas, }; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to get account: ${error.message}`); } throw error; } }
  • MCP server dispatch handler: validates input arguments and calls the core getAccount implementation, formats response as MCP content.
    case "zetrix_get_account": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getAccount(args.address as string); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • src/index.ts:69-82 (registration)
    Tool registration in the tools list used by MCP ListTools handler, includes name, description, and input schema.
    { name: "zetrix_get_account", description: "Get Zetrix account information including balance and metadata", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, }, required: ["address"], }, },
  • TypeScript interface defining the output structure of the account data returned by the handler.
    export interface ZetrixAccount { address: string; balance: string; nonce: number; metadata?: any; }

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