AST structural search
ast_searchRun tree-sitter queries against source files to locate AST captures with line numbers, enabling structural pattern matching beyond grep.
Instructions
Run a tree-sitter query (S-expression pattern) against a source file and return captures with line numbers. Use for AST-shaped matching that Grep cannot express.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | file path | |
| limit | No | max captures returned (default 50, hard max 200) | |
| offset | No | skip the first N captures before applying limit | |
| pattern | Yes | tree-sitter query pattern, e.g. (method_invocation name: (identifier) @m) | |
| language | No | override language inference |