list_wallets
Retrieve a list of all available wallets managed by the Rootstock MCP Server for querying, transacting, and managing assets on the Rootstock blockchain.
Instructions
List all available wallets
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:602-621 (handler)Primary MCP tool handler for 'list_wallets'. Retrieves wallets from WalletManager, formats a list indicating the current wallet, and returns as text content.private async handleListWallets() { const wallets = this.walletManager.listWallets(); const currentAddress = this.walletManager.getCurrentAddress(); let response = `Available Wallets (${wallets.length}):\n\n`; for (const wallet of wallets) { const isCurrent = wallet.address.toLowerCase() === currentAddress.toLowerCase(); response += `${isCurrent ? '→ ' : ' '}${wallet.address}${isCurrent ? ' (current)' : ''}\n`; } return { content: [ { type: 'text', text: response, }, ], }; }
- src/index.ts:199-206 (registration)Tool registration in getAvailableTools(), including name, description, and empty input schema (no parameters required). Used by ListToolsRequestSchema handler.{ name: 'list_wallets', description: 'List all available wallets', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:202-205 (schema)Input schema definition for 'list_wallets' tool: empty object since the tool takes no parameters.inputSchema: { type: 'object', properties: {}, },
- src/wallet-manager.ts:154-166 (helper)Core helper method in WalletManager that lists all stored wallets as WalletInfo[] (addresses and public keys only, no private keys).listWallets(): WalletInfo[] { const walletList: WalletInfo[] = []; for (const [_address, wallet] of this.wallets) { walletList.push({ address: wallet.address, publicKey: 'publicKey' in wallet ? (wallet as any).publicKey : undefined, // Don't expose private keys in list }); } return walletList; }
- src/smithery-server.ts:143-179 (handler)Alternative handler implementation for 'list_wallets' tool in the Smithery-specific MCP server, using direct server.tool() registration with Zod schema (empty).server.tool( "list_wallets", "List all available wallets", {}, async () => { try { // This tool doesn't require authentication - it can list empty wallets const wallets = walletManager.listWallets(); const currentAddress = walletManager.getCurrentAddress(); let response = `Available Wallets (${wallets.length}):\n\n`; for (const wallet of wallets) { const isCurrent = wallet.address.toLowerCase() === currentAddress.toLowerCase(); response += `${isCurrent ? '→ ' : ' '}${wallet.address}${isCurrent ? ' (current)' : ''}\n`; } return { content: [ { type: "text", text: response, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error listing wallets: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );