zetrix_get_account_base
Retrieve basic account information for a Zetrix blockchain address, providing essential details without assets or metadata.
Instructions
Get basic account information without assets and metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The Zetrix account address |
Implementation Reference
- src/zetrix-client.ts:338-357 (handler)Core handler function that executes the tool logic by querying the Zetrix RPC endpoint /getAccountBase for basic account details (address, balance, nonce). Handles API errors and response parsing.async getAccountBase(address: string): Promise<ZetrixAccountBase> { try { const response = await this.client.get("/getAccountBase", { params: { address }, }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } return response.data.result; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to get account base: ${error.message}`); } throw error; } }
- src/index.ts:873-886 (handler)MCP server handler (switch case) that receives tool calls, extracts the address argument, invokes ZetrixClient.getAccountBase(), and formats the response as MCP content.case "zetrix_get_account_base": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getAccountBase(args.address as string); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:141-154 (registration)Tool registration in the MCP tools array, including name, description, and input schema requiring an 'address' string.{ name: "zetrix_get_account_base", description: "Get basic account information without assets and metadata", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, }, required: ["address"], }, },
- src/zetrix-client.ts:83-89 (schema)TypeScript interface defining the structure of the account base response (address, balance, nonce, optional priv).export interface ZetrixAccountBase { address: string; balance: string; nonce: number; priv?: any; }