find_hotspots
Ranks C/C++ functions by caller count across the call graph to surface high-impact hotspots for refactoring, optimization, or testing.
Instructions
Find the most-called C/C++ functions ranked by caller count — libclang call-graph hotspot detection. Identifies functions with the most architectural weight — good targets for refactoring, optimization, or extra testing. Text-based search cannot aggregate caller statistics across the full call graph.
Use for high-level impact assessment: changing a hotspot affects many call sites. The result tells you which functions carry the most "architectural weight" across the entire codebase.
By default, SDK/vendor paths are auto-excluded so hotspots reflect
project code. Use project_only=False to see all results including
vendor code.
For the callers of a specific hotspot, follow up with find_callers
or find_all_callers_recursive.
Read-only. No side effects. Requires the reference index
(fw-context index — refs on by default).
Args:
project_root: Project root. Auto-detected if omitted.
project: Project name or project_id — call list_projects to get them. Use
it to ask about a project that is not the project of the current
directory. It is an alternative to project_root, which takes a root
path. Give one of the two, not both.
limit: Number of top-called functions per page (default 20, max 50).
offset: Skip this many results. Reads further down the ranking;
the page notice names the offset to use.
project_only: When True (default), filters to is_project = 1
symbols so hotspots reflect project code.
exclude_paths: Additional LIKE patterns to exclude (user-supplied
tool parameter). E.g. ['lib/%'].
variant: Build variant (multi-build project). Omit to use
default_variant. One query answers for ONE build.
image: Sysbuild image within the variant. Required when the
variant holds several: each image is a separate program.
Returns: list of dicts, each with: name, qualified_name, kind, signature, file (str — absolute), line, caller_count (int — total number of call sites).
Never empty: one dict with ``info`` replaces an empty result.
Check that key first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | No | Sysbuild image within the variant. Required when the variant holds several: each image is a separate program. | |
| limit | No | Number of top-called functions per page (default 20, max 50). | |
| offset | No | Skip this many results. Reads further down the ranking. | |
| project | No | Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. | |
| variant | No | Build variant (multi-build project). Omit to use default_variant. One query answers for ONE build. | |
| project_only | No | When True (default), auto-excludes SDK/vendor paths so hotspots reflect project code. | |
| project_root | No | Project root. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those. | |
| exclude_paths | No | Additional LIKE patterns to exclude. Merged with defaults. E.g. ['lib/%']. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |