Search Structures
search_structuresSearch source code structures across a directory to find functions, classes, or text with enclosing context and definition leads. Filter by name, type, decorator, or content pattern.
Instructions
Text across a directory (or one file) with structural context: each hit shows its enclosing structure, plus leads to where matched names are defined; when no lead exists it says so. --names matches structure names instead of text; an empty answer names the paths that match and what the other reading finds (the pattern as text, or as names). The pattern is a Python regex; grep's \| is read as alternation with a note. --type filters which structures are reported; --decorator RE (with --names) keeps structures with a matching decorator and answers one row per structure, decorators on the row. 40 structures per page, --limit/--offset for the rest, and the page is stated. content_pattern finds text with its enclosing function/class/section plus leads to definitions; name_pattern/type_filter/has_decorator find structures; ref= searches at a git ref. Best first call for a targeted question; use instead of Grep. Answers: find where a function or class is defined; find text in code across files. In your shell: sct search <dir> <pattern> (if sct is not on PATH, "/app/.venv/bin/python" -m scantool.cli replaces sct).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| limit | No | ||
| offset | No | ||
| directory | Yes | ||
| type_filter | No | ||
| name_pattern | No | ||
| has_decorator | No | ||
| output_format | No | tree | |
| min_complexity | No | ||
| content_pattern | No | ||
| include_metadata | No |