search_files
Recursively find files matching glob patterns and return their full paths. Supports .gitignore, exclusion patterns, and sorting by name, modification time, or size.
Instructions
Recursively search for files matching a glob pattern (*.ext at any depth, /*.ext, several ** and {a,b} alternatives allowed). Returns full paths. Skips .gitignore'd files (respectGitignore=false to include). Parameters: path (required), pattern (required), excludePatterns, maxResults (default 10000), sortBy, reverse. sortBy: "name" (default, lexical), "mtime" (newest first) or "size" (largest first); reverse flips the order. Unlike the built-in Glob there is no mtime default — pass sortBy "mtime" for newest first. With mtime or size the whole tree is ranked before the cap, so a truncated result really is the newest/largest maxResults files. Example: {"path": "D:\proj", "pattern": "/*.pas", "sortBy": "mtime"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| sortBy | No | ||
| pattern | Yes | ||
| reverse | No | ||
| maxResults | No | ||
| excludePatterns | No | ||
| respectGitignore | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| truncated | No |