Search files by name or content
search_filesSearch files recursively by glob and optional content regex to locate matches under a directory; skips symlinks and caps returned results.
Instructions
Recursively search below a root for files matching a glob and optionally a regular expression in their contents. Symlinks are skipped. Returns up to max_results matches.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Glob for names or relative paths, e.g. "*.js" or "src/**/*.ts". Default "*". | |
| root | No | Directory to search. Default $HOME. | |
| query | No | Regular expression to match in file contents. | |
| max_depth | No | Directory depth limit. Default 12. | |
| max_results | No | Default 100. | |
| case_sensitive | No | Case-sensitive content matching. Default true. | |
| include_hidden | No | Include hidden files and directories. Default false. | |
| max_file_bytes | No | Skip content search in larger files. Default 1 MiB. |