Skip to main content
Glama

wallet_from_encrypted_json

Generate a wallet by decrypting an encrypted JSON file using a password. Ideal for accessing Ethereum and EVM-compatible wallets securely.

Instructions

Create a wallet by decrypting an encrypted JSON wallet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesThe encrypted JSON wallet
passwordYesThe password to decrypt the wallet

Implementation Reference

  • The core handler function that decrypts an encrypted JSON wallet file using ethers.Wallet.fromEncryptedJson, optionally connects it to the current provider, and returns the wallet's address, private key, and public key.
    export const fromEncryptedJsonHandler = async (input: any): Promise<ToolResultSchema> => {
      try {
        if (!input.json) {
          return createErrorResponse("Encrypted JSON is required");
        }
    
        if (!input.password) {
          return createErrorResponse("Password is required");
        }
    
        const wallet = await ethers.Wallet.fromEncryptedJson(input.json, input.password);
        const provider = getProvider()
    
        if (provider) {
          wallet.connect(provider);
        }
    
        return createSuccessResponse(
        `Wallet created from encrypted JSON successfully
          Address: ${wallet.address}
          Private Key: ${wallet.privateKey}
          Public Key: ${wallet.publicKey}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to create wallet from encrypted JSON: ${(error as Error).message}`);
      }
    };
  • Tool definition including name, description, and input schema specifying required 'json' and 'password' parameters.
    {
      name: "wallet_from_encrypted_json",
      description: "Create a wallet by decrypting an encrypted JSON wallet",
      inputSchema: {
        type: "object",
        properties: {
          json: { type: "string", description: "The encrypted JSON wallet" },
          password: { type: "string", description: "The password to decrypt the wallet" }
        },
        required: ["json", "password"]
      }
    },
  • src/tools.ts:563-563 (registration)
    Maps the tool name 'wallet_from_encrypted_json' to its handler function in the central handlers dictionary.
    "wallet_from_encrypted_json": fromEncryptedJsonHandler,
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions decryption but doesn't disclose security implications (e.g., password handling), error conditions (e.g., invalid JSON/password), or what the created wallet enables (e.g., signing transactions). This is inadequate for a tool that handles sensitive credentials.

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 unnecessary words. It's appropriately sized and front-loaded with the core action.

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?

For a tool that handles encrypted data and passwords with no annotations or output schema, the description is insufficient. It lacks details on security practices, error handling, return values, or integration with sibling tools (e.g., what operations the created wallet supports). More context is needed given the sensitivity and complexity.

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?

Schema description coverage is 100%, with both parameters clearly documented in the schema. The description adds no additional parameter semantics beyond implying the JSON is encrypted and requires a password for decryption, which is already evident from parameter names and schema descriptions.

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 ('Create a wallet') and method ('by decrypting an encrypted JSON wallet'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'wallet_from_mnemonic' or 'wallet_from_private_key', which are alternative wallet creation methods.

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 existing encrypted wallet), nor does it compare to sibling tools like 'wallet_create_random' for new wallets or 'wallet_from_mnemonic' for recovery.

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

Related 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/dcSpark/mcp-cryptowallet-evm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server