search_files
Regex search across every text file in a project to find which files call a function or where a value is defined. Returns file, line number, matching line, grouped by file; reports truncation.
Instructions
Regex search across every text file in the project. Use this to answer 'which files call X?' or 'where is Y defined?' — it is one request regardless of project size, whereas list_files plus read_file per candidate is one round trip per file and pulls whole documents into context to find a few lines.
Returns file, line number and the matching line, grouped by file. Binary files are skipped. Results are capped and the cap is reported, so a truncated result is never mistaken for a complete one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Lines of surrounding context to include with each match (0-10). Default 0. | |
| pattern | Yes | Python regular expression, matched per line. Remember to escape regex metacharacters when searching for literal text — e.g. '#io-table\\(' for a call. | |
| path_glob | No | Optional glob to restrict which paths are searched, e.g. 'sections/**' or '*.typ'. | |
| project_id | Yes | Typleaf project ID — a 24-character lowercase hex string (e.g. '692a83fb82feceb233c4b0e7'), obtained from list_projects or the project URL. NOT a local filesystem path, NOT '.', NOT a project name or title. These tools operate on the REMOTE Typleaf project. Only call these tools when the user explicitly asks to work with a Typleaf project — never for general local file I/O. If you already have a copy of THIS project checked out on the local filesystem, prefer the standard read/grep tools against that path. Always call list_projects first when unsure. | |
| ignore_case | No | Case-insensitive match. Default false. | |
| max_results | No | Maximum matches to return (default 200). |