Skip to main content
Glama
Alihkhawaher

Everything Search MCP Server

by Alihkhawaher

search

Search for files on your system using advanced options like regex, case sensitivity, and sorting to quickly locate documents, applications, and media.

Instructions

Search for files using Everything Search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query
scopeNoSearch scope (default: C:)
caseSensitiveNoMatch case
wholeWordNoMatch whole words only
regexNoUse regular expressions
pathNoSearch in paths
maxResultsNoMaximum number of results (1-1000, default: 100)
sortByNoSort results by
ascendingNoSort in ascending order

Implementation Reference

  • Zod schema defining input parameters for the 'search' tool, including query, scope, search options, sorting, and pagination.
    const SearchSchema = z.object({
      query: z.string().describe("Search query"),
      scope: z.string().default("C:").describe("Search scope (default: C:)"),
      caseSensitive: z.boolean().default(false).describe("Match case"),
      wholeWord: z.boolean().default(false).describe("Match whole words only"),
      regex: z.boolean().default(false).describe("Use regular expressions"),
      path: z.boolean().default(false).describe("Search in paths"),
      maxResults: z.number().min(1).max(1000).default(32).describe("Maximum number of results (1-1000, default: 32 for HTML, 4294967295 for JSON)"),
      sortBy: z.enum(['name', 'path', 'size', 'date_modified']).default('name').describe("Sort results by"),
      ascending: z.boolean().default(true).describe("Sort in ascending order"),
      offset: z.number().min(0).default(0).describe("Display results from the nth result")
    });
  • Core handler function 'searchFiles' that executes the file search by querying the Everything Search HTTP API (localhost:8011), handles parameters, rate limiting, error handling, and returns raw results.
    const searchFiles = async (params) => {
      try {
        // Add rate limiting
        await new Promise(resolve => setTimeout(resolve, 100));
    
        // Properly handle scope concatenation
        const searchQuery = params.scope ?
          params.scope.endsWith('\\') ?
            `${params.scope}${params.query}` :
            `${params.scope}\\${params.query}` :
          params.query;
    
        const response = await axios.get("http://localhost:8011/", {
          params: {
            search: searchQuery,
            json: 1,
            path_column: 1,
            size_column: 1,
            date_modified_column: 1,
            case: params.caseSensitive ? 1 : 0,
            wholeword: params.wholeWord ? 1 : 0,
            regex: params.regex ? 1 : 0,
            path: params.path ? 1 : 0,
            count: params.maxResults,
            offset: params.offset,
            sort: params.sortBy,
            ascending: params.ascending ? 1 : 0
          },
          timeout: 10000 // 10 second timeout
        });
    
        // Validate response structure
        if (!response.data || typeof response.data.totalResults === 'undefined') {
          throw new Error('Invalid response from Everything Search API');
        }
    
        // Handle empty results according to API documentation
        if (!response.data.results) {
          response.data.results = [];
          response.data.totalResults = 0;
        }
    
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          console.error('Axios error details:', {
            code: error.code,
            message: error.message,
            response: error.response?.data,
            config: {
              url: error.config?.url,
              params: error.config?.params
            }
          });
          if (error.code === 'ECONNREFUSED') {
            throw new Error(
              "Could not connect to Everything Search. Make sure the HTTP server is enabled in Everything's settings (Tools > Options > HTTP Server)."
            );
          }
          if (error.code === 'ETIMEDOUT') {
            throw new Error("Everything Search API request timed out. The server might be busy or unresponsive.");
          }
          throw new Error(`Everything Search API error: ${error.message}`);
        }
        console.error('Non-Axios error:', error);
        throw error;
      }
    };
  • Helper function to format file sizes from bytes to human-readable units (KB, MB, etc.).
    const formatFileSize = (size) => {
      if (!size) return "N/A";
    
      const bytes = parseInt(size);
      if (isNaN(bytes)) return "N/A";
    
      const units = ['bytes', 'KB', 'MB', 'GB', 'TB'];
      let value = bytes;
      let unitIndex = 0;
    
      while (value >= 1024 && unitIndex < units.length - 1) {
        value /= 1024;
        unitIndex++;
      }
    
      return `${value.toFixed(2)} ${units[unitIndex]}`;
    };
  • Helper function to convert Windows FILETIME to readable date string, handling invalid dates.
    const formatFileTime = (fileTime) => {
      if (!fileTime || fileTime === "" || fileTime === "0") return "No date";
    
      try {
        const bigIntTime = BigInt(fileTime);
        if (bigIntTime === 0n) return "No date";
    
        const windowsMs = bigIntTime / 10000n;
        const epochDiffMs = 11644473600000n;
        const unixMs = Number(windowsMs - epochDiffMs);
        const dateObj = new Date(unixMs);
    
        // Check if date is valid (not 1980-02-01 which indicates invalid/placeholder date)
        if (dateObj.getFullYear() === 1980 && dateObj.getMonth() === 1 && dateObj.getDate() === 1) {
          return "No date";
        }
    
        return dateObj.toLocaleString();
      } catch (error) {
        console.error('Date conversion error:', error);
        console.error('Value:', fileTime);
        return "Invalid date";
      }
    };
  • src/server.js:143-146 (registration)
    Registration of the 'search' tool in server capabilities, providing description and input schema.
    search: {
      description: "Search for files using Everything Search",
      inputSchema: zodToJsonSchema(SearchSchema)
    }
  • src/server.js:152-158 (registration)
    Handler for 'listTools' request that registers and describes the 'search' tool.
    server.setRequestHandler("listTools", async () => ({
      tools: [{
        name: "search",
        description: "Search for files using Everything Search",
        inputSchema: zodToJsonSchema(SearchSchema)
      }]
    }));
  • Tool execution handler in 'callTool' request: validates args, calls searchFiles, formats results with helpers, returns MCP response.
    if (name === "search") {
      const validatedArgs = SearchSchema.parse(args);
      const results = await searchFiles(validatedArgs);
    
      const formattedResults = results.results.length > 0
        ? results.results.map((result) => {
            const size = result.type === "folder" ? "(folder)" : formatFileSize(result.size);
            const date = formatFileTime(result.date_modified);
            return `Name: ${result.name}\nPath: ${result.path}\nSize: ${size}\nModified: ${date}\n`;
          }).join("\n")
        : "No results found";
    
      const summary = `Found ${results.totalResults} results:\n\n`;
    
      return {
        content: [{
          type: "text",
          text: summary + formattedResults
        }]
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Everything Search' which implies a file search tool, but doesn't describe what the tool returns (e.g., list of files, metadata), error conditions, performance characteristics, or any limitations. This leaves significant gaps in understanding how the tool behaves beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy for an agent to quickly understand the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no output schema, and no annotations), the description is insufficient. It doesn't explain what the tool returns, how results are formatted, any limitations of 'Everything Search', or error handling. For a search tool with many parameters, more context is needed to help the agent use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, providing clear documentation for all 9 parameters. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting without compensating for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Search for') and resource ('files') using a specific technology ('Everything Search'), which gives a good sense of what the tool does. However, without sibling tools to differentiate from, it cannot achieve a perfect score of 5, as there's no explicit distinction from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or specific contexts. It simply states what the tool does without any usage instructions or exclusions, leaving the agent without direction on appropriate application.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Alihkhawaher/everything-search-server'

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