Search Files by Name
search_filesSearch for files using glob patterns within a specified directory. Provide pattern, directory, and optional result limit to receive matching file paths.
Instructions
Find files matching a glob pattern within a directory (e.g. "**/.ts", ".log").
Args:
directory (string): Base directory to search within.
pattern (string): Glob pattern to match filenames against.
max_results (number, optional): Cap on returned results. Default: 50.
Returns: a list of matching file paths, relative to the search directory.
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": {
"directory": "<directory>",
"pattern": "<pattern>"
},
"name": "search_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Glob pattern, e.g. "**/*.ts" | |
| directory | Yes | Base directory to search within | |
| max_results | No | Maximum results to return |