stop_watching
Stop monitoring a log file to halt real-time analysis and debugging of server logs.
Instructions
Stop monitoring a specific log file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the log file to stop monitoring |
Implementation Reference
- src/server.ts:388-404 (handler)The main MCP tool handler for 'stop_watching'. Validates the filePath argument, calls FileWatcher.stopWatching(), and returns a success response with confirmation message.private async handleStopWatching(args: any): Promise<MCPToolResult> { const { filePath } = args; if (!filePath || typeof filePath !== 'string') { throw new Error('filePath is required and must be a string'); } await this.fileWatcher.stopWatching(filePath); return { success: true, data: { message: `Stopped watching ${filePath}`, filePath } }; }
- src/server.ts:122-135 (registration)Tool registration in ListTools handler, including name, description, and input schema definition requiring 'filePath'.{ name: 'stop_watching', description: 'Stop monitoring a specific log file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the log file to stop monitoring' } }, required: ['filePath'] } },
- src/tools/fileWatcher.ts:79-87 (helper)Core helper method in FileWatcher class that closes the chokidar file watcher for the specified path and removes it from the internal tracking map.async stopWatching(filePath: string): Promise<void> { const watchedFile = this.watchers.get(filePath); if (!watchedFile) { throw new Error(`File ${filePath} is not being watched`); } await watchedFile.watcher.close(); this.watchers.delete(filePath); }