Skip to main content
Glama

zetrix_sdk_get_nonce

Retrieve the transaction sequence number 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

  • Handler for zetrix_sdk_get_nonce tool: extracts address argument, calls zetrixSDK.getNonce, and returns formatted response.
    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-468 (registration)
    Registers the tool in the MCP server with name, description, and input schema requiring address.
    { 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"], },
  • ZetrixSDK.getNonce implementation: initializes SDK if needed, calls underlying SDK's account.getNonce, handles errors, returns nonce.
    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)}` ); } }

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