Skip to main content
Glama

zetrix_crypto_validate_key

Validate Zetrix blockchain private keys, public keys, or addresses to ensure correct format and prevent transaction errors.

Instructions

Validate private key, public key, or address format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesType of key to validate
valueYesThe key or address to validate

Implementation Reference

  • Handler function for the zetrix_crypto_validate_key tool. Validates the input type (privateKey, publicKey, or address) and delegates to the corresponding validation method in ZetrixEncryption.
    case "zetrix_crypto_validate_key": { if (!args) { throw new Error("Missing arguments"); } let isValid = false; const type = args.type as string; const value = args.value as string; if (type === "privateKey") { isValid = await zetrixEncryption.isValidPrivateKey(value); } else if (type === "publicKey") { isValid = await zetrixEncryption.isValidPublicKey(value); } else if (type === "address") { isValid = await zetrixEncryption.isValidAddress(value); } return { content: [ { type: "text", text: JSON.stringify({ type, value, isValid }, null, 2), }, ], }; }
  • src/index.ts:564-582 (registration)
    Tool registration in the tools array, defining name, description, and input schema for MCP server.
    { 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"], }, },
  • Input schema defining the expected parameters: type (enum) and value.
    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"], },
  • Core validation logic for private keys using the zetrix-encryption-nodejs KeyPair.checkEncPrivateKey method.
    async isValidPrivateKey(privateKey: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkEncPrivateKey(privateKey); } catch (error) { return false; } }
  • Core validation logic for public keys using the zetrix-encryption-nodejs KeyPair.checkEncPublicKey method.
    async isValidPublicKey(publicKey: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkEncPublicKey(publicKey); } catch (error) { return false; } }
  • Core validation logic for addresses using the zetrix-encryption-nodejs KeyPair.checkAddress method.
    async isValidAddress(address: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkAddress(address); } catch (error) { return false; } }

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