Skip to main content
Glama

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
NameRequiredDescriptionDefault
filePathYesPath to the log file to stop monitoring

Implementation Reference

  • 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']
      }
    },
  • 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);
    }

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/ChiragPatankar/loganalyzer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server