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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"address": "<address>"
},
"name": "set_current_wallet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Wallet address to set as current |
Implementation Reference
- src/index.ts:817-831 (handler)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}`); } } - src/wallet-manager.ts:144-149 (helper)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(); } - src/index.ts:385-397 (schema)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 }); - src/smithery-server.ts:463-491 (registration)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)}`, }, ], }; } }