Skip to main content
Glama

Rootstock MCP Server

by cuongpo

get_current_wallet

Retrieve active wallet details using the Rootstock MCP Server, enabling quick access to blockchain asset management and transaction data.

Instructions

Get the current active wallet information

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • The main handler function for the 'get_current_wallet' tool. It retrieves the current wallet address and detailed information using the WalletManager and formats the response.
    private async handleGetCurrentWallet() { try { const address = this.walletManager.getCurrentAddress(); const walletInfo = this.walletManager.getWalletInfo(address); return { content: [ { type: 'text', text: `Current Wallet:\n\nAddress: ${walletInfo.address}\nPublic Key: ${walletInfo.publicKey}\nPrivate Key: ${walletInfo.privateKey}`, }, ], }; } catch (error) { throw new Error(`Failed to get current wallet: ${error}`); } }
  • Schema definition for the 'get_current_wallet' tool in the list of available tools, specifying no input parameters.
    { name: 'get_current_wallet', description: 'Get the current active wallet information', inputSchema: { type: 'object', properties: {}, }, },
  • src/index.ts:126-127 (registration)
    Registration and dispatch point in the CallToolRequestSchema handler switch statement that routes calls to the tool handler.
    case 'get_current_wallet': return await this.handleGetCurrentWallet();
  • Core helper method in WalletManager that retrieves the current wallet object, used extensively across tool handlers.
    getCurrentWallet(): ethers.Wallet | ethers.HDNodeWallet { if (!this.currentWallet) { throw new Error('No current wallet set'); } return this.getWallet(this.currentWallet); }
  • Helper method directly used by the tool handler to get the current wallet address.
    getCurrentAddress(): string { if (!this.currentWallet) { throw new Error('No current wallet set'); } return this.wallets.get(this.currentWallet)!.address; }

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