Skip to main content
Glama

zetrix_get_account_assets

Retrieve asset holdings for a Zetrix blockchain account. Specify an address to view all assets, or add optional asset code and issuer parameters to filter results.

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 function in ZetrixClient that executes the API call to retrieve account assets from the Zetrix node.
    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; } }
  • src/index.ts:155-176 (registration)
    Tool registration in the tools array, including name, description, and input schema.
    { 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"], }, },
  • MCP server request handler switch case that dispatches to ZetrixClient.getAccountAssets and formats the response.
    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 tool.
    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