Skip to main content
Glama

zetrix_get_account_metadata

Retrieve metadata associated with a Zetrix blockchain account address, optionally filtering by specific key to access account information stored on-chain.

Instructions

Get metadata associated with an account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Zetrix account address
keyNoSpecific metadata key (optional)

Implementation Reference

  • Core handler function that queries the Zetrix RPC API /getAccountMetaData endpoint to retrieve account metadata, handling optional specific key and error cases.
    async getAccountMetadata( address: string, key?: string ): Promise<ZetrixAccountMetadata[]> { try { const params: any = { address }; if (key) { params.key = key; } const response = await this.client.get("/getAccountMetaData", { params }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } // If a specific key is requested, the result is keyed by that key name // Otherwise it returns metadatas array const result = response.data.result; if (key && result[key]) { return [result[key]]; } return result.metadatas || []; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to get account metadata: ${error.message}`); } throw error; } }
  • MCP server handler case that extracts arguments and calls the ZetrixClient.getAccountMetadata method, formatting response as MCP content.
    case "zetrix_get_account_metadata": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getAccountMetadata( args.address as string, args.key as string | undefined ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • Input schema definition for the tool, specifying required address and optional key parameters.
    inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, key: { type: "string", description: "Specific metadata key (optional)", }, }, required: ["address"], },
  • src/index.ts:177-194 (registration)
    Tool registration in the tools array used by MCP server.setRequestHandler(ListToolsRequestSchema).
    { name: "zetrix_get_account_metadata", description: "Get metadata associated with an account", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, key: { type: "string", description: "Specific metadata key (optional)", }, }, required: ["address"], }, },
  • TypeScript interface defining the structure of account metadata returned by the handler.
    export interface ZetrixAccountMetadata { key: string; value: string; version: number; }

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