Skip to main content
Glama

find_hotspots

Find the most-called C/C++ functions by caller count to prioritize refactoring, optimization, and testing. Uses full call-graph statistics, with vendor paths excluded by default.

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. limit: Number of top-called functions to return (default 20). 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/%'].

Returns: list of dicts, each with: name, qualified_name, kind, file, line, caller_count (int — total number of call sites), signature.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageNoSysbuild image name within the variant (multi-project). Omit for all images of the variant.
limitNoNumber of top-called functions to return (default 20).
variantNoBuild variant name (multi-project). Omit to use default_variant or fail-closed. Use '*' for all variants.
project_onlyNoWhen True (default), auto-excludes SDK/vendor paths so hotspots reflect project code.
project_rootNoProject root. Auto-detected if omitted.
exclude_pathsNoAdditional LIKE patterns to exclude. Merged with defaults. E.g. ['lib/%'].

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full weight and excels: declares 'Read-only. No side effects.' and requires the reference index. It also discloses the default path exclusions and the project_only behavior, giving the agent a complete safety and behavior picture.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage, args, returns) and front-loaded purpose. It is a bit verbose, but each section contributes meaningful context, so it remains efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter tool with no annotations, the description is remarkably complete: it covers purpose, usage context, default behaviors, prerequisites, side-effect profile, exclusions, and return format. It fully compensates for the lack of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds extra context beyond schema, such as explaining project_only filters to is_project=1 symbols and that exclude_paths are merged with defaults. This modest addition justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Find the most-called C/C++ functions ranked by caller count' and identifies it as libclang call-graph hotspot detection. This specific verb+resource phrasing distinguishes it from sibling tools like find_callers or search_code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it ('high-level impact assessment'), contrasts with text-based search capabilities, and names follow-up tools (find_callers, find_all_callers_recursive). Also explains the default exclusion of SDK/vendor paths and how to toggle it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/turbyho/fw-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server