Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_sdk_get_nonce

Retrieve the transaction sequence number (nonce) for a Zetrix blockchain account to ensure proper transaction ordering and prevent replay attacks.

Instructions

Get account nonce (transaction sequence number)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Zetrix account address

Implementation Reference

  • Core implementation of getNonce that wraps the official zetrix-sdk-nodejs SDK's account.getNonce method.
    async getNonce(address: string): Promise<number> {
      await this.initSDK();
    
      try {
        const result = await this.sdk.account.getNonce(address);
    
        if (result.errorCode !== 0) {
          throw new Error(result.errorDesc || `SDK Error: ${result.errorCode}`);
        }
    
        return result.result.nonce;
      } catch (error) {
        throw new Error(
          `Failed to get nonce: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • MCP server handler for the tool that extracts arguments and calls ZetrixSDK.getNonce.
    case "zetrix_sdk_get_nonce": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const nonce = await zetrixSDK.getNonce(args.address as string);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ address: args.address, nonce }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:456-469 (registration)
    Tool registration in the MCP tools list, including name, description, and input schema.
    {
      name: "zetrix_sdk_get_nonce",
      description: "Get account nonce (transaction sequence number)",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "The Zetrix account address",
          },
        },
        required: ["address"],
      },
    },
  • Input schema definition for the tool.
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "The Zetrix account address",
          },
        },
        required: ["address"],
      },
    },

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