Skip to main content
Glama

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"], }, },

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