find_in_files
Search file contents for a regex pattern across a directory tree. Returns matching lines with file and line references to find code elements.
Instructions
Search file contents for a regex pattern across a directory tree (like grep -rn). Returns matching lines with file:line references (max 60 results). Use this to find function definitions, imports, error messages, or any text in a codebase. pattern: a regular expression (e.g. "def train", "import pandas", "TODO") directory: root directory to search from file_glob: filter by filename pattern, e.g. ".py", ".ts", ".json", "" for all files
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| directory | Yes | ||
| file_glob | No | *.py |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |