Search Structures
search_structuresFind code structures or text with context: each match shows its enclosing function/class plus where names are defined. Filters by type, name pattern, or decorator.
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, and an empty answer names the paths that match. The pattern is a Python regex; grep's \| is read as alternation with a note. --type filters which structures are reported. 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. 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 |