sgraph_search_elements
Find code elements by name pattern using wildcards or regex—a precise alternative to grep. Returns matches with counts, filterable by class, function, method, file, or directory.
Instructions
Find code elements by name pattern. Use instead of grep for precise symbol lookup.
When to use:
You know a class/function name but not its file location
You want to find all implementations of a pattern (e.g., "Service", "*Handler")
You need to locate a symbol before querying its dependencies
Parameters:
query: Wildcards ("Service") or regex (".Service.") or substring ("Service")
scope_path: Limit to subtree - faster, fewer results. Auto-set if server has default scope.
element_types: Filter by ["class", "function", "method", "file", "dir"]
model_id: Omit to use auto-loaded model
Returns JSON with match count and element list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |