Skip to main content
Glama

list_watched_files

Display all log files currently under active monitoring for real-time analysis and debugging purposes.

Instructions

List all currently monitored log files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_watched_files' that delegates to FileWatcher.listWatchedFiles() and formats the response as MCPToolResult.
    private async handleListWatchedFiles(args: any): Promise<MCPToolResult> {
      const watchedFiles = await this.fileWatcher.listWatchedFiles();
    
      return {
        success: true,
        data: watchedFiles
      };
    }
  • Input schema definition for the tool (empty object since no parameters required).
    inputSchema: {
      type: 'object',
      properties: {}
    }
  • src/server.ts:136-143 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'list_watched_files',
      description: 'List all currently monitored log files',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Helper method in FileWatcher class that lists all watched files with their status, recent errors count, and last update time.
    async listWatchedFiles(): Promise<FileWatchResult[]> {
      const results: FileWatchResult[] = [];
    
      for (const [filePath, watchedFile] of this.watchers) {
        results.push({
          filePath,
          newErrors: watchedFile.errors.slice(-5), // Last 5 errors
          totalErrors: watchedFile.errors.length,
          lastUpdate: watchedFile.lastUpdate
        });
      }
    
      return results;
    }
  • src/server.ts:189-191 (registration)
    Dispatch/registration case in the CallToolRequestSchema switch statement that routes to the handler.
    case 'list_watched_files':
      result = await this.handleListWatchedFiles(args);
      break;

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