search_code
Search project files using regex or substring patterns. Returns highlighted snippets with file path and line number, no index required.
Instructions
Live regex/substring search across project files.
No index required — scans files directly each time. Useful for finding usages, checking for patterns, or searching non-PHP files.
Args: pattern: Python regex or plain substring to search for. Examples: "UserRepository", "findByEmail(", "#[Route" path_glob: Glob relative to project root. Default: /*.php Other examples: src//.php, templates/**/.twig, config/**/*.yaml, **/*.php context_lines: Lines of surrounding context to show (0–5). Default: 2. max_results: Max matching snippets to return (1–200). Default: 30.
Returns highlighted snippets with file path and line number.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| path_glob | No | **/*.php | |
| context_lines | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |