Skip to main content
Glama

Rootstock MCP Server

by cuongpo

set_current_wallet

Set the active wallet address for executing transactions on the Rootstock blockchain via the MCP server.

Instructions

Set the current active wallet for transactions

Input Schema

NameRequiredDescriptionDefault
addressYesWallet address to set as current

Input Schema (JSON Schema)

{ "properties": { "address": { "description": "Wallet address to set as current", "type": "string" } }, "required": [ "address" ], "type": "object" }

Implementation Reference

  • MCP tool handler that processes the set_current_wallet call, invokes walletManager.setCurrentWallet, and returns a confirmation message.
    private async handleSetCurrentWallet(params: { address: string }) { try { this.walletManager.setCurrentWallet(params.address); return { content: [ { type: 'text', text: `Current wallet set to: ${params.address}`, }, ], }; } catch (error) { throw new Error(`Failed to set current wallet: ${error}`); } }
  • Core WalletManager method that validates the wallet exists and sets it as the current active wallet.
    setCurrentWallet(address: string): void { if (!this.wallets.has(address.toLowerCase())) { throw new Error(`Wallet not found for address: ${address}`); } this.currentWallet = address.toLowerCase(); }
  • Tool schema definition including name, description, and input schema for validation in the tools list.
    name: 'set_current_wallet', description: 'Set the current active wallet for transactions', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Wallet address to set as current', }, }, required: ['address'], }, },
  • src/index.ts:123-124 (registration)
    Dispatch registration in the CallToolRequestSchema handler switch statement.
    case 'set_current_wallet': return await this.handleSetCurrentWallet((args || {}) as unknown as { address: string });
  • Alternative stubbed registration and handler in smithery-server using direct server.tool call with zod schema.
    server.tool( "set_current_wallet", "Set the current active wallet for transactions", { address: z.string().describe("Wallet address to set as current"), }, async ({ address }) => { try { // Note: WalletManager doesn't have setCurrentAddress method, // this would need to be implemented or use a different approach return { content: [ { type: "text", text: `Note: Setting current wallet functionality needs to be implemented in WalletManager. Address: ${address}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error setting current wallet: ${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