Skip to main content
Glama

zetrix_get_account_assets

Retrieve asset holdings for a Zetrix blockchain account, including specific assets by code and issuer when needed.

Instructions

Get asset holdings for an account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Zetrix account address
codeNoAsset code (optional, must be used with issuer)
issuerNoAsset issuer address (optional, must be used with code)

Implementation Reference

  • Core handler implementation in ZetrixClient class. Makes HTTP GET request to Zetrix RPC /getAccountAssets endpoint with address (required) and optional code/issuer filters. Returns array of assets or empty array.
    async getAccountAssets( address: string, code?: string, issuer?: string ): Promise<ZetrixAccountAsset[]> { try { const params: any = { address }; if (code && issuer) { params.code = code; params.issuer = issuer; } const response = await this.client.get("/getAccountAssets", { params }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } return response.data.result.assets || []; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to get account assets: ${error.message}`); } throw error; } }
  • Tool definition including name, description, and input schema (JSON Schema) specifying required 'address' and optional 'code'/'issuer' parameters.
    { name: "zetrix_get_account_assets", description: "Get asset holdings for an account", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, code: { type: "string", description: "Asset code (optional, must be used with issuer)", }, issuer: { type: "string", description: "Asset issuer address (optional, must be used with code)", }, }, required: ["address"], }, },
  • src/index.ts:888-905 (registration)
    MCP server request handler switch case that extracts arguments and delegates execution to ZetrixClient.getAccountAssets(), formats result as text content.
    case "zetrix_get_account_assets": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getAccountAssets( args.address as string, args.code as string | undefined, args.issuer as string | undefined ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • TypeScript interface defining the structure of account asset objects returned by the handler.
    export interface ZetrixAccountAsset { amount: string; key: { code: string; issuer: string; }; }

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