search_code
Locate code across multiple repositories by query, returning file and line positions, or include surrounding context; filter by repo, file pattern, regex, and result count.
Instructions
Search code across repos. mode=locations (default) omits line text; mode=context includes context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "locations" (default) returns file+line number only; "context" also returns the matched line text and context_lines surrounding lines | locations |
| repo | No | Repo to search: "all" searches every configured repo; otherwise a single name or comma-separated list, e.g. "pypto,simpler" | all |
| query | Yes | Search term. Treated as a fixed string unless use_regex=True | |
| file_glob | No | Filename glob filter, e.g. "*.py", "*.cc", "**/*.mlir". Default "*" matches all files. | * |
| use_regex | No | Treat query as a regular expression (ripgrep syntax). Default False uses fixed-string matching. | |
| max_results | No | Maximum number of match lines to return (1–2000) | |
| context_lines | No | Lines of context to include around each match. Only used when mode=context. | |
| group_by_file | No | When True, include a files[] list sorted by match count |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||