monitor.stop
Stop the wallet monitoring loop to end copy-trading, change bot configuration, or switch between preview and live modes. Does not close open positions; exit them separately. Safe to call when monitor is off.
Instructions
Stop the background wallet monitoring loop started by monitor.start. Call this to end a copy-trading session, before changing bot configuration via config.set or config.safety_limits, or when switching between preview and live modes via config.go_live. Does NOT close open positions — use positions.close or positions.set_exit_rules separately to unwind trades. Idempotent: safe to call when the monitor is not running. Returns a short confirmation string. No parameters. Pro feature.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/stop-monitor.ts:1-16 (handler)The actual handler function 'handleStopMonitor' that implements the tool logic: checks license, checks if monitor is running, calls monitor.stop(), and returns a confirmation.
import { WalletMonitor } from "../services/wallet-monitor.js"; import { checkLicense, requirePro } from "../utils/license.js"; export async function handleStopMonitor(monitor: WalletMonitor): Promise<string> { const isPro = await checkLicense(); if (!isPro) { return requirePro("stop_monitor"); } const status = monitor.getStatus(); if (!status.running) { return "Monitor is not running."; } monitor.stop(); return "Monitor stopped."; } - src/index.ts:183-188 (registration)Registration of the 'monitor.stop' tool with the MCP server, including its description, empty schema (no params), and the handler callback that invokes handleStopMonitor.
server.tool( "monitor.stop", "Stop the background wallet monitoring loop started by monitor.start. Call this to end a copy-trading session, before changing bot configuration via config.set or config.safety_limits, or when switching between preview and live modes via config.go_live. Does NOT close open positions — use positions.close or positions.set_exit_rules separately to unwind trades. Idempotent: safe to call when the monitor is not running. Returns a short confirmation string. No parameters. Pro feature.", {}, safe("monitor.stop", async () => ({ content: [{ type: "text" as const, text: await handleStopMonitor(walletMonitor) }] })) );