Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_crypto_verify

Verify digital signatures on the Zetrix blockchain by checking a signature against a message and public key to confirm authenticity.

Instructions

Verify a signature against a message and public key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe original message (hex string)
signatureYesThe signature to verify
publicKeyYesThe public key to verify against

Implementation Reference

  • MCP tool handler that validates input arguments and calls zetrixEncryption.verify to perform the signature verification, then returns the result.
    case "zetrix_crypto_verify": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const isValid = await zetrixEncryption.verify(
        args.message as string,
        args.signature as string,
        args.publicKey as string
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ isValid }, null, 2),
          },
        ],
      };
    }
  • Core verify function that initializes the encryption library and calls the underlying signature.verify method to check if the signature matches the message and public key.
    async verify(
      message: string,
      signData: string,
      publicKey: string
    ): Promise<boolean> {
      await this.initEncryption();
    
      try {
        return this.signature.verify(message, signData, publicKey);
      } catch (error) {
        throw new Error(
          `Failed to verify signature: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Tool schema definition including name, description, and input schema for validating message, signature, and publicKey parameters.
    {
      name: "zetrix_crypto_verify",
      description: "Verify a signature against a message and public key",
      inputSchema: {
        type: "object",
        properties: {
          message: {
            type: "string",
            description: "The original message (hex string)",
          },
          signature: {
            type: "string",
            description: "The signature to verify",
          },
          publicKey: {
            type: "string",
            description: "The public key to verify against",
          },
        },
        required: ["message", "signature", "publicKey"],
      },
    },
  • src/index.ts:60-766 (registration)
    Tool registration in the tools array used by ListToolsRequestHandler to expose the tool to MCP clients.
    const tools: Tool[] = [
      {
        name: "zetrix_check_health",
        description: "Check the health status of the Zetrix node",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_get_account",
        description: "Get Zetrix account information including balance and metadata",
        inputSchema: {
          type: "object",
          properties: {
            address: {
              type: "string",
              description: "The Zetrix account address",
            },
          },
          required: ["address"],
        },
      },
      {
        name: "zetrix_get_block",
        description: "Get information about a specific block by height",
        inputSchema: {
          type: "object",
          properties: {
            blockNumber: {
              type: "number",
              description: "The block height/number to query",
            },
          },
          required: ["blockNumber"],
        },
      },
      {
        name: "zetrix_get_latest_block",
        description: "Get the latest block information from Zetrix blockchain",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_get_transaction",
        description: "Get transaction details by transaction hash",
        inputSchema: {
          type: "object",
          properties: {
            hash: {
              type: "string",
              description: "The transaction hash",
            },
          },
          required: ["hash"],
        },
      },
      {
        name: "zetrix_get_balance",
        description: "Get the ZETRIX balance of an account. Returns balance in both ZETA (micro units) and ZETRIX (main units). Note: 1 ZETRIX = 1,000,000 ZETA",
        inputSchema: {
          type: "object",
          properties: {
            address: {
              type: "string",
              description: "The Zetrix account address",
            },
          },
          required: ["address"],
        },
      },
      {
        name: "zetrix_create_keypair",
        description: "Generate a new public-private key pair (for testing only)",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        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"],
        },
      },
      {
        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"],
        },
      },
      {
        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"],
        },
      },
      {
        name: "zetrix_get_transaction_history",
        description: "Get completed transaction records",
        inputSchema: {
          type: "object",
          properties: {
            hash: {
              type: "string",
              description: "Transaction hash (optional)",
            },
            ledgerSeq: {
              type: "number",
              description: "Block sequence number (optional)",
            },
          },
        },
      },
      {
        name: "zetrix_get_transaction_cache",
        description: "Get pending transactions not yet executed",
        inputSchema: {
          type: "object",
          properties: {
            hash: {
              type: "string",
              description: "Transaction hash (optional)",
            },
            limit: {
              type: "number",
              description: "Number of pending transactions to return (optional)",
            },
          },
        },
      },
      {
        name: "zetrix_get_ledger",
        description: "Get block/ledger information with optional details",
        inputSchema: {
          type: "object",
          properties: {
            seq: {
              type: "number",
              description: "Block sequence number (optional)",
            },
            withValidator: {
              type: "boolean",
              description: "Include validator list (optional)",
            },
            withConsValue: {
              type: "boolean",
              description: "Include consensus value (optional)",
            },
            withFee: {
              type: "boolean",
              description: "Include fee configuration (optional)",
            },
          },
        },
      },
      {
        name: "zetrix_multi_query",
        description: "Execute multiple API queries simultaneously",
        inputSchema: {
          type: "object",
          properties: {
            items: {
              type: "array",
              description: "Array of query objects",
            },
          },
          required: ["items"],
        },
      },
      {
        name: "zetrix_get_transaction_blob",
        description: "Serialize transaction data into hexadecimal format",
        inputSchema: {
          type: "object",
          properties: {
            transaction: {
              type: "object",
              description: "Transaction object with source_address, nonce, fee_limit, gas_price, operations",
            },
          },
          required: ["transaction"],
        },
      },
      {
        name: "zetrix_submit_transaction",
        description: "Submit signed transaction to blockchain for execution",
        inputSchema: {
          type: "object",
          properties: {
            transactionBlob: {
              type: "string",
              description: "Serialized transaction blob",
            },
            signatures: {
              type: "array",
              description: "Array of signature objects with sign_data and public_key",
            },
          },
          required: ["transactionBlob", "signatures"],
        },
      },
      {
        name: "zetrix_call_contract",
        description: "Call smart contract in sandbox environment for debugging",
        inputSchema: {
          type: "object",
          properties: {
            contractAddress: {
              type: "string",
              description: "Deployed contract address (optional)",
            },
            code: {
              type: "string",
              description: "Contract source code (optional)",
            },
            input: {
              type: "string",
              description: "Function parameters (optional)",
            },
            contractBalance: {
              type: "string",
              description: "Contract balance (optional)",
            },
            feeLimit: {
              type: "string",
              description: "Fee limit (optional)",
            },
            gasPrice: {
              type: "string",
              description: "Gas price (optional)",
            },
            optType: {
              type: "number",
              description: "Operation type (optional)",
            },
            sourceAddress: {
              type: "string",
              description: "Source address (optional)",
            },
          },
        },
      },
      {
        name: "zetrix_test_transaction",
        description: "Evaluate transaction fees without blockchain submission",
        inputSchema: {
          type: "object",
          properties: {
            items: {
              type: "array",
              description: "Array of test transaction items",
            },
          },
          required: ["items"],
        },
      },
      {
        name: "zetrix_ws_connect",
        description: "Connect and register to Zetrix WebSocket for real-time updates",
        inputSchema: {
          type: "object",
          properties: {
            apiList: {
              type: "array",
              description: "Optional list of API message types to register (numbers)",
            },
          },
        },
      },
      {
        name: "zetrix_ws_submit_transaction",
        description: "Submit transaction via WebSocket and get real-time status updates",
        inputSchema: {
          type: "object",
          properties: {
            transaction: {
              type: "object",
              description: "Transaction object",
            },
            signatures: {
              type: "array",
              description: "Array of signature objects with public_key and sign_data",
            },
            trigger: {
              type: "object",
              description: "Optional trigger object",
            },
          },
          required: ["transaction", "signatures"],
        },
      },
      {
        name: "zetrix_ws_subscribe_tx",
        description: "Subscribe to transaction notifications for specific addresses",
        inputSchema: {
          type: "object",
          properties: {
            addresses: {
              type: "array",
              description: "Array of account addresses to subscribe to",
            },
          },
          required: ["addresses"],
        },
      },
      {
        name: "zetrix_ws_disconnect",
        description: "Disconnect from WebSocket",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_ws_status",
        description: "Check WebSocket connection status",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_sdk_create_account",
        description: "Create a new Zetrix account using the official SDK",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_sdk_get_balance",
        description: "Get account balance using the official SDK",
        inputSchema: {
          type: "object",
          properties: {
            address: {
              type: "string",
              description: "The Zetrix account address",
            },
          },
          required: ["address"],
        },
      },
      {
        name: "zetrix_sdk_is_activated",
        description: "Check if an account is activated on the blockchain",
        inputSchema: {
          type: "object",
          properties: {
            address: {
              type: "string",
              description: "The Zetrix account address",
            },
          },
          required: ["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"],
        },
      },
      {
        name: "zetrix_sdk_call_contract",
        description: "Call a smart contract function (query only, no state change) using SDK",
        inputSchema: {
          type: "object",
          properties: {
            contractAddress: {
              type: "string",
              description: "The deployed smart contract address",
            },
            input: {
              type: "string",
              description: "JSON string with method and params",
            },
            sourceAddress: {
              type: "string",
              description: "Optional source address for the call",
            },
          },
          required: ["contractAddress"],
        },
      },
      {
        name: "zetrix_sdk_invoke_contract",
        description: "Invoke a smart contract function with state change (requires private key)",
        inputSchema: {
          type: "object",
          properties: {
            sourceAddress: {
              type: "string",
              description: "The account address initiating the transaction",
            },
            privateKey: {
              type: "string",
              description: "Private key for signing the transaction",
            },
            contractAddress: {
              type: "string",
              description: "The smart contract address to invoke",
            },
            amount: {
              type: "string",
              description: "Amount of ZTX to send with invocation (in micro-ZTX)",
            },
            input: {
              type: "string",
              description: "JSON string with method and params",
            },
            metadata: {
              type: "string",
              description: "Optional transaction description",
            },
          },
          required: ["sourceAddress", "privateKey", "contractAddress", "amount", "input"],
        },
      },
    
      // Encryption Tools
      {
        name: "zetrix_crypto_generate_keypair",
        description: "Generate a new Zetrix key pair with private key, public key, and address",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_crypto_get_public_key",
        description: "Derive public key from private key",
        inputSchema: {
          type: "object",
          properties: {
            privateKey: {
              type: "string",
              description: "The encrypted private key",
            },
          },
          required: ["privateKey"],
        },
      },
      {
        name: "zetrix_crypto_get_address",
        description: "Get Zetrix address from public key",
        inputSchema: {
          type: "object",
          properties: {
            publicKey: {
              type: "string",
              description: "The public key",
            },
          },
          required: ["publicKey"],
        },
      },
      {
        name: "zetrix_crypto_validate_key",
        description: "Validate private key, public key, or address format",
        inputSchema: {
          type: "object",
          properties: {
            type: {
              type: "string",
              enum: ["privateKey", "publicKey", "address"],
              description: "Type of key to validate",
            },
            value: {
              type: "string",
              description: "The key or address to validate",
            },
          },
          required: ["type", "value"],
        },
      },
      {
        name: "zetrix_crypto_sign",
        description: "Sign a message with a private key",
        inputSchema: {
          type: "object",
          properties: {
            message: {
              type: "string",
              description: "The message to sign (hex string)",
            },
            privateKey: {
              type: "string",
              description: "The private key to sign with",
            },
          },
          required: ["message", "privateKey"],
        },
      },
      {
        name: "zetrix_crypto_verify",
        description: "Verify a signature against a message and public key",
        inputSchema: {
          type: "object",
          properties: {
            message: {
              type: "string",
              description: "The original message (hex string)",
            },
            signature: {
              type: "string",
              description: "The signature to verify",
            },
            publicKey: {
              type: "string",
              description: "The public key to verify against",
            },
          },
          required: ["message", "signature", "publicKey"],
        },
      },
      {
        name: "zetrix_crypto_encrypt_key",
        description: "Encrypt a private key with a password for secure storage",
        inputSchema: {
          type: "object",
          properties: {
            privateKey: {
              type: "string",
              description: "The private key to encrypt",
            },
            password: {
              type: "string",
              description: "The password to use for encryption",
            },
          },
          required: ["privateKey", "password"],
        },
      },
      {
        name: "zetrix_crypto_decrypt_key",
        description: "Decrypt an encrypted private key with a password",
        inputSchema: {
          type: "object",
          properties: {
            encryptedData: {
              type: "string",
              description: "The encrypted keystore data",
            },
            password: {
              type: "string",
              description: "The password used for encryption",
            },
          },
          required: ["encryptedData", "password"],
        },
      },
    
      // Smart Contract Development Tools
      {
        name: "zetrix_contract_get_chain_functions",
        description: "Get documentation for all built-in Chain object functions available in Zetrix smart contracts",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_contract_get_utils_functions",
        description: "Get documentation for all built-in Utils object functions available in Zetrix smart contracts",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_contract_get_structure_guide",
        description: "Get guide on how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "zetrix_contract_get_token_standard",
        description: "Get token standard specification (ZTP20, ZTP721, or ZTP1155)",
        inputSchema: {
          type: "object",
          properties: {
            standard: {
              type: "string",
              enum: ["ZTP20", "ZTP721", "ZTP1155"],
              description: "Token standard to get documentation for",
            },
          },
          required: ["standard"],
        },
      },
      {
        name: "zetrix_contract_init_dev_environment",
        description: "Initialize a new Zetrix smart contract development environment using create-zetrix-tool. This creates a complete project structure with testing framework, examples, and utilities.",
        inputSchema: {
          type: "object",
          properties: {
            contractName: {
              type: "string",
              description: "Name of the contract project to create (alphanumeric and hyphens only)",
            },
            workingDirectory: {
              type: "string",
              description: "Directory where to create the project (defaults to current directory)",
            },
          },
          required: ["contractName"],
        },
      },
      {
        name: "zetrix_contract_generate_advanced",
        description: "Generate advanced multi-class Zetrix smart contract with interfaces, libraries, utilities, main contract, and comprehensive test specs. **MANDATORY WORKFLOW: (1) First call zetrix_contract_init_dev_environment with contractName (e.g., 'CertificateContract'). (2) Then call this tool with the SAME contractName and outputDirectory set to './{contractName}'. Calling this tool WITHOUT initializing the project first will result in an error.** Supports complex architectures with inheritance, composition, and modular design.",
        inputSchema: {
          type: "object",
          properties: {
            contractName: {
              type: "string",
              description: "Name of the main contract (e.g., 'StableCoin', 'NFTMarketplace')",
            },
            contractType: {
              type: "string",
              enum: ["token", "nft", "defi", "governance", "marketplace", "custom"],
              description: "Type of contract to generate",
            },
            features: {
              type: "array",
              items: {
                type: "string",
                enum: ["pausable", "ownable", "roles", "upgradeable", "whitelist", "blacklist", "timelock", "oracle"],
              },
              description: "Advanced features to include",
            },
            tokenStandard: {
              type: "string",
              enum: ["ZTP20", "ZTP721", "ZTP1155"],
              description: "Token standard (required if contractType is 'token' or 'nft')",
            },
            includeTests: {
              type: "boolean",
              description: "Generate comprehensive test specifications (default: true)",
            },
            outputDirectory: {
              type: "string",
              description: "Directory to output the contract files (defaults to current directory)",
            },
          },
          required: ["contractName", "contractType"],
        },
      },
      {
        name: "zetrix_contract_get_testing_guide",
        description: "Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility for behavioral disclosure. While 'verify' implies a read-only, non-destructive operation, the description doesn't explicitly state this. It also omits important behavioral details like what cryptographic algorithm is used, whether the verification is deterministic, what happens on failure (e.g., returns false vs throws error), or any rate limits. For a cryptographic verification tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a straightforward verification tool and is front-loaded with the essential action. Every word earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of cryptographic verification and the absence of both annotations and an output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., boolean success/failure, detailed validation result), doesn't mention error conditions, and provides no context about the cryptographic ecosystem. For a tool that could have security implications, this leaves too much undefined.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions all three parameters (signature, message, public key) but adds no semantic information beyond what the schema already provides. With 100% schema description coverage where each parameter has clear descriptions, the description doesn't enhance understanding of parameter relationships, formats (beyond 'hex string' for message), or validation requirements. This meets the baseline for high schema coverage but doesn't add value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('verify') and identifies the key resources involved (signature, message, public key). It distinguishes this as a verification operation rather than signing or key generation, which helps differentiate it from sibling tools like zetrix_crypto_sign and zetrix_crypto_generate_keypair. However, it doesn't explicitly contrast with those siblings in the description text itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a signature from zetrix_crypto_sign), when verification is appropriate (e.g., after receiving signed data), or what scenarios require this tool over other cryptographic operations. With many sibling tools in the crypto and contract domains, this lack of contextual guidance is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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