Skip to main content
Glama

Windows Automation MCP Server

search_files

Search for files using wildcard patterns in specified directories to locate documents, applications, or system files on Windows systems.

Instructions

搜索文件(支持通配符)

Input Schema

NameRequiredDescriptionDefault
directoryYes搜索目录
patternYes搜索模式(如 *.txt)

Input Schema (JSON Schema)

{ "properties": { "directory": { "description": "搜索目录", "type": "string" }, "pattern": { "description": "搜索模式(如 *.txt)", "type": "string" } }, "required": [ "directory", "pattern" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the search_files tool by running a Windows 'dir' command to find files matching the pattern in the directory.
    async searchFiles(directory, pattern) { try { const { stdout } = await execAsync( `dir /s /b "${path.join(directory, pattern)}"`, { shell: 'cmd.exe' } ); const files = stdout.trim().split('\n').filter(f => f); return { success: true, files, count: files.length }; } catch (error) { return { success: false, error: error.message, files: [] }; } }
  • The schema definition for the search_files tool, including input parameters for directory and pattern.
    { name: 'search_files', description: '搜索文件(支持通配符)', inputSchema: { type: 'object', properties: { directory: { type: 'string', description: '搜索目录' }, pattern: { type: 'string', description: '搜索模式(如 *.txt)' }, }, required: ['directory', 'pattern'], }, },
  • The dispatch/registration in the executeTool method's switch statement that routes to the searchFiles handler.
    case 'search_files': return await this.searchFiles(args.directory, args.pattern);
  • Inclusion of 'search_files' in the canHandle tools list.
    'delete_file', 'copy_file', 'move_file', 'search_files'];
  • The name registration within the tool definitions array.
    name: 'search_files',

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/eva-wanxin-git/windows-automation-mcp'

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