lookup_symbol
Find symbol declarations and definitions by exact name or prefix match across a C/C++ codebase. Returns kind, file, line, signature, and docstring.
Instructions
Look up a symbol by name — exact or prefix matching.
Returns all declarations and definitions matching the name across the entire indexed codebase. Prefer this over search_code when you know the exact symbol name. Use search_code for keyword/concept search.
Read-only: yes. May auto-reindex stale files (non-blocking).
Args: name: Symbol name (exact match) or prefix (set exact=False). E.g. 'uart_init' finds the exact function; 'uart_' finds all symbols starting with 'uart_'. project_root: Project directory. Auto-detected if omitted. exact: True = exact name match, False = prefix LIKE match (default). limit: Maximum results (default 50).
Returns: list[dict]: Symbols with name, qualified_name, kind, file, line, signature, docstring, is_definition fields. Empty if not found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Symbol name. Exact match if exact=True, prefix LIKE match otherwise. E.g. 'uart_init' or 'uart_'. | |
| project_root | No | Project root directory. Auto-detected from CWD if omitted. | |
| exact | No | True = exact name match, False = prefix LIKE match (default). | |
| limit | No | Maximum results returned (default 50). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |