generate_algorand_account
Create a new Algorand account with a unique address and mnemonic for secure blockchain interactions using the Algorand MCP Server.
Instructions
Generate a new Algorand account with address and mnemonic
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/algorand.ts:101-106 (handler)Core tool logic: generates a new Algorand account using algosdk.generateAccount() and converts secret key to mnemonic.generateAccount(): { account: algosdk.Account; mnemonic: string } { const account = algosdk.generateAccount(); const mnemonic = algosdk.secretKeyToMnemonic(account.sk); return { account, mnemonic }; }
- src/index.ts:498-521 (handler)MCP server handler for the tool: validates arguments, calls AlgorandService.generateAccount(), and formats response.case 'generate_algorand_account': { GenerateAccountArgsSchema.parse(args); try { const { account, mnemonic } = algorandService.generateAccount(); return { content: [ { type: 'text', text: `New Algorand Account Generated:\nAddress: ${account.addr}\nMnemonic: ${mnemonic}\n\n⚠️ SECURITY WARNING: Store the mnemonic phrase securely and never share it. This is required to access your account.`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error generating account: ${error}`, }, ], isError: true, }; } }
- src/index.ts:34-34 (schema)Zod validation schema for tool input arguments (no required parameters).const GenerateAccountArgsSchema = z.object({});
- src/index.ts:156-164 (registration)Tool registration in the TOOLS array exported for MCP server, including name, description, and input schema.{ name: 'generate_algorand_account', description: 'Generate a new Algorand account with address and mnemonic', inputSchema: { type: 'object', properties: {}, required: [], }, },