Skip to main content
Glama

evm_import_wallet

Restore an EVM wallet from a private key or BIP39 mnemonic and optionally set a BIP44 derivation path to recover or migrate accounts across supported chains.

Instructions

Import existing wallet from private key or BIP39 mnemonic with custom derivation path.

Reconstructs wallet from either a raw private key or mnemonic seed phrase. Supports custom BIP44 derivation paths for advanced use cases. Essential for wallet recovery and migration.

CRITICAL RULES:

  • Must provide either privateKey OR mnemonic (not both, not neither)

  • Private keys are 64 hex characters (with or without 0x prefix)

  • Mnemonics are 12 or 24 words separated by spaces

  • Custom derivation paths must follow BIP44 format

  • Imported wallet works across all EVM chains

PARAMETERS:

  • chain: EVM chain context (required)

    • Doesn't affect import (same wallet works everywhere)

    • Used for consistency with other wallet tools

  • privateKey: Raw private key (optional - use if you have key)

    • Format: 0x followed by 64 hex characters OR 64 hex without prefix

    • Example: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

    • Takes precedence if both privateKey and mnemonic provided

  • mnemonic: BIP39 seed phrase (optional - use if you have mnemonic)

    • 12 or 24 words separated by single spaces

    • Example: "test test test test test test test test test test test junk"

    • Requires derivationPath parameter to generate specific address

  • derivationPath: BIP44 path (optional, default: m/44'/60'/0'/0/0)

    • Only used with mnemonic imports

    • Format: m/44'/60'/account'/change/index

    • Default generates first address (index 0)

    • Example: "m/44'/60'/0'/0/5" for 6th address

EXAMPLES: ✅ Import from private key: {chain: "polygon", privateKey: "0xac0974..."}

✅ Import from mnemonic (default path): {chain: "ethereum", mnemonic: "test test test..."}

✅ Import specific address from mnemonic: {chain: "bsc", mnemonic: "word1 word2...", derivationPath: "m/44'/60'/0'/0/5"}

❌ Invalid - neither key nor mnemonic: {chain: "polygon"}

❌ Invalid - wrong key format: {chain: "ethereum", privateKey: "1234"}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating operation success • chain: Chain context used • address: Derived public address (0x...) • privateKey: Private key (0x... - KEEP SECRET) • derivationPath: Path used (only for mnemonic imports) • importMethod: "privateKey" or "mnemonic" • warning: Security reminder • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Providing both privateKey and mnemonic (only one needed)

  • Wrong mnemonic word count (must be 12 or 24)

  • Invalid derivation path format

  • Not securing imported credentials

  • Importing production keys in development environments

USE CASES:

  • Recover wallet from backup

  • Migrate wallet between applications

  • Import MetaMask/hardware wallet addresses

  • Restore from mnemonic backup

  • Generate multiple addresses from one seed

IMPORT STRATEGIES:

  • Private Key: Direct import, works immediately

  • Mnemonic + Default Path: Import first wallet address

  • Mnemonic + Custom Path: Import specific account/address

  • Hardware Wallet Compatibility: Use standard paths

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>"
    },
    "name": "evm_import_wallet"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain context
mnemonicNoMnemonic phrase (12 or 24 words, optional)
privateKeyNoPrivate key (0x... or 64 hex chars, optional)
derivationPathNoBIP44 derivation path (optional, default: m/44'/60'/0'/0/0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations the description carries the full burden and mostly delivers: it discloses that the chain parameter does not affect the import, that the call returns a sensitive private key ('KEEP SECRET'), and that testnet keys are involved. However it is internally inconsistent, stating 'Must provide either privateKey OR mnemonic (not both, not neither)' and later 'Takes precedence if both privateKey and mnemonic provided', and it never says whether the imported wallet is persisted server-side.

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

Conciseness2/5

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

Critical rules and examples are well front-loaded and labeled, but the bulk of the text does not serve an import operation: a seven-chain table with block times and gas commentary, a CRITICAL GAS CONSIDERATIONS section, testnet faucet notes, and Linux package-manager/'xdg-open' notes that leak from the runtime environment. Roughly half the description is noise that dilutes the operative rules and creates a risk the agent confuses importing a wallet with transacting.

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

Completeness4/5

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

For a mutation-style tool with no annotations and no output schema, the description compensates by documenting the return fields (address, privateKey, derivationPath, importMethod, warning) and by listing COMMON MISTAKES. It is close to complete; the gaps are the both-parameters contradiction and the absence of any statement about whether the secret is stored or only returned.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, and this description clearly exceeds it: it gives concrete formats (64 hex with/without 0x), an example key, mnemonic word counts, BIP44 path grammar, the default path and its index semantics, and the chain parameter's irrelevance. The only loss is the unresolved conflict over whether supplying both privateKey and mnemonic is valid or just resolved by precedence.

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

Purpose5/5

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

States a specific verb and resource ('Import existing wallet') plus the two accepted input forms (private key or BIP39 mnemonic) and the customization axis (derivation path). The word 'import'/'reconstructs' implicitly but clearly separates it from evm_create_wallet, so an agent can pick correctly without reading either schema.

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

Usage Guidelines4/5

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

Provides explicit trigger scenarios ('Essential for wallet recovery and migration', USE CASES: recover from backup, migrate between applications, import MetaMask/hardware wallet addresses) and an IMPORT STRATEGIES section mapping input type to outcome. It does not name a sibling alternative or state when NOT to use it (e.g. use evm_create_wallet for a fresh wallet), which keeps it below a 5.

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

Deploy Server

Other Tools