Search Files
search_filesFind files and directories by name using glob patterns under a specified path; matches paths only and returns full locations without reading file contents.
Instructions
Find files and directories by NAME, not by content: this tool never reads or searches inside files. It walks the tree under 'path' and matches a glob pattern against each entry's path relative to 'path' (case-sensitive). Use '.ext' to match entries directly under 'path', and '**/.ext' or '**/name' to match at any depth. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"pattern": "<pattern>"
},
"name": "search_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The directory to search under. Absolute, or relative to an allowed directory; it must resolve inside the allowed directories. | |
| pattern | Yes | Glob matched against each entry's path relative to path, never its content: '*.ts' matches directly under path, '**/*.ts' at any depth. | |
| excludePatterns | No | Patterns for entries to leave out, with their contents, matched against each entry's path relative to path. A pattern with no '*' matches that name at any depth ('node_modules' leaves out every node_modules directory); a pattern with '*' is a glob matched as written, and one ending in '/**' also leaves out the directory it names. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes |