Ask clangd about a C/C++ symbol
crosspad_symbolLocate C/C++ symbol definitions, references, implementations, and callers via clangd; get hover type docs and file outlines from compile_commands.json.
Instructions
Compiler-backed symbol intelligence via clangd: references, implementations, hover, call hierarchy, definition and a file's symbol outline. It reads the project's compile_commands.json: references (who calls this), implementations (what overrides this virtual), hover (resolved type and doc comment), call_hierarchy (incoming callers), definition, document_symbols (outline of one file). Give a symbol name (resolved through clangd's index) or an exact file + line (+ character), 1-based. project picks pc or idf; by default whichever was built most recently. Needs clangd (found on PATH or in an ESP-IDF, emsdk, Homebrew, Xcode or VS Code install) and a build that emitted compile_commands.json (crosspad_build); both are reported as typed errors, never a hang. With no clangd at all, definition and references fall back to an approximate text search (engine: text). The FIRST call on a cold tree can take a minute or two while the index builds (platform-idf is ~1950 translation units). For a plain 'where is X declared' across every repo, crosspad_search_symbols is cheaper.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "crosspad_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Source file — absolute, or relative to the project root. Required for document_symbols | |
| line | No | 1-based line, when pointing at an exact position instead of naming a symbol | |
| limit | No | Maximum results (default 30) | |
| action | No | What to ask clangd (default: definition) | definition |
| symbol | No | Symbol name, optionally qualified: 'PadManager' or 'PadManager::handlePadPress' | |
| project | No | Which compilation database to index (default: the most recently built) | |
| character | No | 1-based column within `line` (default 1) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docs | No | ||
| next | No | ||
| note | No | ||
| calls | No | ||
| count | No | ||
| error | No | ||
| hover | No | ||
| action | No | ||
| clangd | No | ||
| engine | No | ||
| notice | No | ||
| project | No | ||
| success | Yes | ||
| symbols | No | ||
| indexing | No | ||
| resolved | No | ||
| locations | No | ||
| truncated | No | ||
| candidates | No | ||
| approximate | No | ||
| install_hint | No | ||
| compile_commands | No |