Skip to main content
Glama
Jake-loranger

Algorand MCP Server

store_wallet

Securely store an Algorand wallet by encrypting its mnemonic phrase with a password for protected access to blockchain accounts and transactions.

Instructions

Securely store a wallet with encrypted mnemonic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesWallet name/identifier
mnemonicYesMnemonic phrase to store securely
passwordYesPassword to encrypt the mnemonic

Implementation Reference

  • Main handler function executing the store_wallet tool: validates input, imports account for address, encrypts mnemonic, stores in walletStorage Map.
    case 'store_wallet': {
        const parsed = StoreWalletArgsSchema.parse(args);
        try {
            // Import account to get address
            const account = algorandService.importAccountFromMnemonic(parsed.mnemonic);
    
            // Encrypt mnemonic
            const { encryptedMnemonic, iv } = algorandService.encryptMnemonic(parsed.mnemonic, parsed.password);
    
            // Store wallet
            walletStorage.set(parsed.name, {
                encryptedMnemonic,
                iv,
                address: account.addr.toString()
            });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Wallet "${parsed.name}" stored securely!\nAddress: ${account.addr}\n\n⚠️ Remember your password - it's required to access the wallet.`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error storing wallet: ${error}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Zod schema for validating store_wallet tool input arguments: name, mnemonic, password.
    const StoreWalletArgsSchema = z.object({
        name: z.string(),
        mnemonic: z.string(),
        password: z.string(),
    });
  • src/index.ts:323-344 (registration)
    Tool registration in the TOOLS array, defining name, description, and input schema for MCP server.
    {
        name: 'store_wallet',
        description: 'Securely store a wallet with encrypted mnemonic',
        inputSchema: {
            type: 'object',
            properties: {
                name: {
                    type: 'string',
                    description: 'Wallet name/identifier',
                },
                mnemonic: {
                    type: 'string',
                    description: 'Mnemonic phrase to store securely',
                },
                password: {
                    type: 'string',
                    description: 'Password to encrypt the mnemonic',
                },
            },
            required: ['name', 'mnemonic', 'password'],
        },
    },
  • Helper method in AlgorandService for encrypting mnemonic using AES-256-GCM with password-derived key.
    encryptMnemonic(mnemonic: string, password: string): { encryptedMnemonic: string; iv: string } {
        const key = crypto.scryptSync(password, 'salt', 32);
        const iv = crypto.randomBytes(16);
        const cipher = crypto.createCipheriv('aes-256-gcm', key, iv);
    
        let encrypted = cipher.update(mnemonic, 'utf8', 'hex');
        encrypted += cipher.final('hex');
    
        const authTag = cipher.getAuthTag();
    
        return {
            encryptedMnemonic: encrypted + ':' + authTag.toString('hex'),
            iv: iv.toString('hex')
        };
    }
  • Helper method to derive Algorand account (including address) from mnemonic phrase.
    importAccountFromMnemonic(mnemonic: string): algosdk.Account {
        return algosdk.mnemonicToSecretKey(mnemonic);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'securely store' and 'encrypted mnemonic', hinting at security measures, but fails to detail aspects like storage location, access controls, error handling, or whether this is a one-time creation versus an update. More behavioral context is needed for a mutation tool.

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 conveys the core functionality without unnecessary words. It is front-loaded and appropriately sized, making it easy to understand 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 tool's complexity as a mutation operation with no annotations and no output schema, the description is insufficient. It lacks details on what happens after storage (e.g., success response, error cases, or how to retrieve the wallet), leaving gaps in understanding the full context of use.

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 all three parameters (name, mnemonic, password). The description adds no additional semantic details beyond what the schema provides, such as format constraints or usage examples, so it meets the baseline for high schema coverage.

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 ('store') and resource ('wallet') with the specific method 'with encrypted mnemonic', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'load_wallet', which might handle retrieval, leaving room for improvement in sibling distinction.

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, such as 'load_wallet' or other wallet-related operations. The description lacks context on prerequisites, exclusions, or recommended scenarios, offering minimal usage direction.

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/Jake-loranger/algorand-mcp-server'

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