Skip to main content
Glama

Rootstock MCP Server

by cuongpo

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • 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: {}, }, },
  • Input schema definition for 'list_wallets' tool: empty object since the tool takes no parameters.
    inputSchema: { type: 'object', properties: {}, },
  • 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; }
  • 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)}`, }, ], }; } } );

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/cuongpo/rootstock-mcp'

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