Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_crypto_decrypt_key

Decrypt encrypted private keys with a password to access Zetrix blockchain accounts and perform secure operations.

Instructions

Decrypt an encrypted private key with a password

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encryptedDataYesThe encrypted keystore data
passwordYesThe password used for encryption

Implementation Reference

  • src/index.ts:641-658 (registration)
    Tool registration including name, description, and input schema definition.
    {
      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"],
      },
    },
  • MCP tool handler in the switch statement that calls ZetrixEncryption.decryptPrivateKey with input arguments and formats the response.
    case "zetrix_crypto_decrypt_key": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const privateKey = await zetrixEncryption.decryptPrivateKey(
        args.encryptedData, // Can be object or string
        args.password as string
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ privateKey }, null, 2),
          },
        ],
      };
    }
  • Core decryption logic wrapping zetrix-encryption-nodejs keystore.decrypt, handling promises and errors.
    async decryptPrivateKey(
      encryptedData: any,
      password: string
    ): Promise<string> {
      await this.initEncryption();
    
      return new Promise((resolve, reject) => {
        try {
          // The decrypt function accepts the object directly
          this.keystore.decrypt(encryptedData, password, (decrypted: string) => {
            if (decrypted) {
              resolve(decrypted);
            } else {
              reject(new Error("Decryption failed: Invalid password or data"));
            }
          });
        } catch (error) {
          reject(
            new Error(
              `Failed to decrypt private key: ${error instanceof Error ? error.message : String(error)}`
            )
          );
        }
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool decrypts a private key with a password, implying it's a read-only operation that returns the decrypted key, but it doesn't disclose critical behavioral traits such as security implications (e.g., handling sensitive data), error conditions (e.g., invalid password), or output format (e.g., raw key vs. structured data).

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 directly states the tool's purpose without any fluff or redundancy. It's front-loaded and wastes no words, 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 operations and the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., the decrypted private key format), security considerations, or error handling, leaving significant gaps for an AI agent to understand the tool's full behavior.

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 input schema has 100% description coverage, clearly documenting both parameters ('encryptedData' and 'password'). The description adds no additional meaning beyond what's in the schema, such as format details (e.g., keystore JSON structure) or usage notes. With high schema coverage, the baseline score of 3 is appropriate.

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 action ('decrypt') and the resource ('encrypted private key'), specifying it requires a password. It distinguishes from sibling 'zetrix_crypto_encrypt_key' by being the inverse operation. However, it doesn't explicitly differentiate from other crypto tools like 'zetrix_crypto_validate_key' or 'zetrix_crypto_sign' in terms of use case.

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 an encrypted key from 'zetrix_crypto_encrypt_key'), exclusions, or scenarios where other tools like 'zetrix_crypto_validate_key' might be more appropriate.

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