find_callees_recursive
Trace all direct and indirect function calls a symbol makes, up to a configurable depth, to analyze dependencies. Uses libclang call graph including function pointers and constructors.
Instructions
Find all transitive C/C++ callees — what name calls, directly or indirectly, through the libclang call graph including function-pointer edges, implicit constructors, and synthetic dispatch edges. libclang-powered: follows function-pointer calls and indirect invocations across the full dependency tree.
Use for dependency analysis: "what does this function depend on to do
its job?" Returns callees at depth 1 (direct), depth 2 (callees of
callees), up to max_depth (default 5). Results are deduplicated
by shortest distance.
Edge types traversed: Includes call, indirect (function
pointers / ISRs), implicit_construct (constructors reachable through
file-scope global objects), and dispatch (synthetic edges through
event loops and thread starts).
Limitation — ambiguous name resolution: When a source-line fallback
cannot disambiguate which method is called, the edge is conservatively
omitted to avoid false callees. If you suspect a missing callee,
verify with search_bodies("target_name").
For direct callees only, get_symbol_context gives a faster flat
list along with the function body and callers. For the reverse
direction use find_all_callers_recursive.
Read-only. No side effects. Requires the reference index
(fw-context index — refs on by default).
Args: name: Symbol name to find transitive callees of. project_root: Project root. Auto-detected if omitted. max_depth: Maximum BFS depth for transitive search (default 5). limit: Maximum results (default 50).
Returns:
list of dicts, each with: callee (str — callee name),
callee_qualified_name (str), depth (int — distance from source),
file (str), line (int), ref_kind ("call" or "indirect").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Symbol name to find transitive callees of. | |
| image | No | Sysbuild image name within the variant (multi-project). Omit for all images of the variant. | |
| limit | No | Maximum results (default 50). | |
| variant | No | Build variant name (multi-project). Omit to use default_variant or fail-closed. Use '*' for all variants. | |
| max_depth | No | Maximum BFS depth for transitive search (default 5). | |
| project_root | No | Project root. Auto-detected if omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |