Skip to main content
Glama

enhanced_search

Perform advanced file searches on macOS, analyze content, and manage tags. Supports regex, filename, content, and tag-based searches within specified directories and file types.

Instructions

Advanced file search with content analysis and tagging

Input Schema

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

Implementation Reference

  • Core handler function implementing the enhanced_search tool logic, dispatching to search or tag operations 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", }; } }
  • MCP CallToolRequest handler dispatch for enhanced_search, validates input and calls core implementation
    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 for MCP ListToolsRequest
    { 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"], }, },
  • Zod schema used for input validation in the 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(), });
  • TypeScript interface defining the parameters for the 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[]; }

Other Tools

Related 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