Skip to main content
Glama
tornikegomareli

macOS Tools MCP Server

enhanced_search

Search macOS files by content, filename, or tags, and manage file tagging for organized retrieval.

Instructions

Advanced file search with content analysis and tagging

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesSearch or manage tags
queryNoSearch query (supports regex)
searchTypeNoType of search to perform
fileTypesNoFile extensions to include
pathNoRoot directory for search
maxResultsNoMaximum number of results
tagsNoTags to search for or apply

Implementation Reference

  • Main handler function for the enhanced_search tool. Dispatches to performSearch for search actions or performTagOperation for tag/untag based on params.action.
    export async function spotlightEnhanced(
      params: EnhancedSearchParams
    ): Promise<SearchResultResponse | TagOperationResult> {
      switch (params.action) {
        case "search":
          return performSearch(params);
        
        case "tag":
        case "untag":
          return performTagOperation(params);
        
        default:
          return {
            status: "error",
            error: "Invalid action",
          };
      }
    }
  • TypeScript interface defining the input parameters schema for enhanced_search tool.
    export interface EnhancedSearchParams {
      action: "search" | "tag" | "untag";
      query?: string;
      searchType?: "content" | "filename" | "tags" | "regex";
      fileTypes?: string[];
      path?: string;
      maxResults?: number;
      tags?: string[];
    }
  • Zod validation schema for enhanced_search tool parameters, used for parsing in the request handler.
    const EnhancedSearchSchema = z.object({
      action: z.enum(["search", "tag", "untag"]),
      query: z.string().optional(),
      searchType: z.enum(["content", "filename", "tags", "regex"]).optional(),
      fileTypes: z.array(z.string()).optional(),
      path: z.string().optional(),
      maxResults: z.number().optional(),
      tags: z.array(z.string()).optional(),
    });
  • src/index.ts:131-142 (registration)
    Dispatch handler in the CallToolRequestSchema that routes enhanced_search calls to the spotlightEnhanced function.
    case "enhanced_search": {
      const params = EnhancedSearchSchema.parse(args);
      const result = await spotlightEnhanced(params);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/index.ts:65-106 (registration)
    Tool registration entry in the tools list advertised via ListToolsRequestSchema, including name, description, and inputSchema.
    {
      name: "enhanced_search",
      description: "Advanced file search with content analysis and tagging",
      inputSchema: {
        type: "object",
        properties: {
          action: {
            type: "string",
            enum: ["search", "tag", "untag"],
            description: "Search or manage tags",
          },
          query: {
            type: "string",
            description: "Search query (supports regex)",
          },
          searchType: {
            type: "string",
            enum: ["content", "filename", "tags", "regex"],
            description: "Type of search to perform",
          },
          fileTypes: {
            type: "array",
            items: { type: "string" },
            description: "File extensions to include",
          },
          path: {
            type: "string",
            description: "Root directory for search",
          },
          maxResults: {
            type: "number",
            description: "Maximum number of results",
          },
          tags: {
            type: "array",
            items: { type: "string" },
            description: "Tags to search for or apply",
          },
        },
        required: ["action"],
      },
    },
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. While 'Advanced file search' implies read operations, and 'tagging' suggests mutation capabilities, the description doesn't clarify permissions needed, whether tagging is destructive/reversible, rate limits, or what the response format looks like. For a tool with both search and mutation capabilities, this is a significant gap.

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 extremely concise at just 7 words, front-loading the core functionality. Every word earns its place by conveying the tool's advanced nature, search capability, content analysis feature, and tagging functionality without any waste.

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?

For a tool with 7 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the relationship between search and tagging operations, doesn't clarify behavioral aspects like permissions or side effects, and provides minimal context beyond the basic purpose. The tool appears to have both read and write capabilities which need more explanation.

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?

With 100% schema description coverage, the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions 'content analysis' which isn't directly reflected in parameters, but doesn't explain how this relates to the documented parameters like 'searchType' or 'query'. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose as 'Advanced file search with content analysis and tagging', which includes a specific verb ('search') and resource ('file') with additional capabilities. However, it doesn't explicitly distinguish this from its sibling tool 'system_performance', which appears unrelated to file search.

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. There's no mention of prerequisites, when this tool is appropriate versus other search methods, or any exclusions. The single sibling tool appears unrelated, so no comparative guidance is provided.

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/tornikegomareli/macos-tools-mcp-server'

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