Skip to main content
Glama

wallet_from_private_key

Generate a wallet for Ethereum and EVM-compatible blockchains using a private key with the MCP Crypto Wallet EVM server. Enables wallet creation for blockchain operations.

Instructions

Create a wallet from a private key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
privateKeyYesThe private key

Implementation Reference

  • The core handler function that implements the wallet_from_private_key tool logic using ethers.Wallet.
    export const fromPrivateKeyHandler = async (input: fromPrivateKeyHandlerInput): Promise<ToolResultSchema> => {
      try {
        if (!input.privateKey) {
          return createErrorResponse("Private key is required");
        }
    
        const provider = getProvider()
        const wallet = new ethers.Wallet(input.privateKey, provider);
    
        return createSuccessResponse(
        `Wallet created from private key successfully:
          Address: ${wallet.address}
          Private Key: ${wallet.privateKey}
          Public Key: ${wallet.publicKey}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to create wallet from private key: ${(error as Error).message}`);
      }
    };
  • MCP tool schema definition with input validation for the privateKey parameter.
    {
      name: "wallet_from_private_key",
      description: "Create a wallet from a private key",
      inputSchema: {
        type: "object",
        properties: {
          privateKey: { type: "string", description: "The private key" }
        },
        required: ["privateKey"]
      }
    },
  • src/tools.ts:561-561 (registration)
    Registration of the tool name to its handler function in the handlers dictionary.
    "wallet_from_private_key": fromPrivateKeyHandler,
  • TypeScript type definition for the input parameters used in the handler.
    export type fromPrivateKeyHandlerInput = {
      privateKey: string;
      provider?: string;
    };
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose security implications (e.g., private key handling), error conditions, or what the created wallet enables (e.g., for signing transactions). This is a significant gap for a tool involving sensitive operations.

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 with zero waste—it directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, 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 (wallet creation involves security and blockchain interactions), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a wallet object) or behavioral traits, leaving gaps for the agent to operate safely and effectively.

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 the parameter 'privateKey' documented as 'The private key'. The description adds no additional meaning beyond this, such as format requirements (e.g., hex string) or validation rules. Baseline 3 is appropriate since the schema does the heavy lifting.

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 the resource ('from a private key'), making the purpose immediately understandable. It distinguishes from siblings like 'wallet_create_random' or 'wallet_from_mnemonic' by specifying the private key source, though it doesn't explicitly contrast them.

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?

No guidance is provided on when to use this tool versus alternatives like 'wallet_from_mnemonic' or 'wallet_from_encrypted_json'. The description lacks context about prerequisites (e.g., needing a valid private key) or typical use cases, leaving the agent to infer usage.

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