explain_symbol
Explains any C/C++ symbol's purpose, inputs, outputs, and side effects using instant pre-computed LLM analysis or on-demand fallback.
Instructions
Explain what a C/C++ symbol does in plain English — libclang-aware
analysis. Uses pre-computed LLM analysis when available (instant),
falls back to on-demand LLM. Falls back to macro explanation when
the name matches a #define.
Read-only. No side effects — uses pre-computed LLM analysis when available
(instant, generated during fw-context index --analyze), falls back to
calling an LLM on-demand. Returns the symbol's purpose, inputs, outputs,
and side effects.
For raw source code use get_source. For symbol metadata without
explanation use lookup_symbol. For body + callers + callees use
get_symbol_context.
Args:
name: Symbol name to explain. E.g. uart_init, ModemMsg::send.
project_root: Project root directory. Auto-detected if omitted.
context_lines: Lines of source context around the symbol definition
(default 40, max 200). Only used when no pre-computed analysis exists.
Returns:
dict: {name, kind, file, line, signature, explanation, llm_analysis
(if pre-computed)}, plus source/explain_prompt on fallback. Macro
fallback returns kind="macro", signature (as #define NAME),
value (raw definition), and expanded_value.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Symbol name to explain. E.g. 'uart_init', 'ModemMsg::send'. | |
| project_root | No | Project root. Auto-detected if omitted. | |
| context_lines | No | Lines of source context around the symbol definition. |