Skip to main content
Glama

find_all_callers_recursive

Find all transitive C/C++ callers of a symbol to assess change impact, tracing direct and indirect call paths through function pointers, constructors, and dispatch edges up to a configurable depth.

Instructions

Find all transitive C/C++ callers — who calls name, directly or indirectly, through the libclang call graph including function-pointer edges, implicit constructors, and synthetic dispatch edges. libclang-powered: follows function-pointer assignments and ISR vector registrations across the full call tree.

Use for impact analysis: "if I change this function, how far does the ripple go?" Returns callers at depth 1 (direct), depth 2 (callers of callers), up to max_depth (default 5). Results are deduplicated — each caller appears once at its shortest distance to the target.

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 (e.g. attach() matching both Timeout::attach and SerialBase::attach), the edge is conservatively omitted to avoid false callers. If you suspect a missing caller, verify with search_bodies("target_name") and find_indirect_targets.

For a flat, single-level caller list use find_callers (faster). For the reverse direction use find_callees_recursive.

Read-only. No side effects. Requires the reference index (fw-context index — refs on by default). BFS from the target outward; performance scales with call-graph fan-out.

Args: name: Symbol name to find transitive callers 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: caller (str — caller name), caller_qualified_name (str), depth (int — distance from target), file (str), line (int), ref_kind ("call" or "indirect").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSymbol name to find transitive callers of.
imageNoSysbuild image name within the variant (multi-project). Omit for all images of the variant.
limitNoMaximum results (default 50).
variantNoBuild variant name (multi-project). Omit to use default_variant or fail-closed. Use '*' for all variants.
max_depthNoMaximum BFS depth for transitive search (default 5).
project_rootNoProject root. Auto-detected if omitted.

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 burden and excels. It discloses read-only semantics ('Read-only. No side effects'), prerequisites ('Requires the reference index'), performance characteristics ('BFS from the target outward; performance scales with call-graph fan-out'), and edge-case behavior (conservative omission of ambiguous edges). It even names the edge types traversed. This goes well beyond the minimum.

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 long but well-structured with a lead sentence, usage context, edge-type bullet, limitation callout, and alternatives. It is front-loaded with the main purpose. Minor redundancy (e.g., 'libclang-powered' repeated implicitly) but every section earns its place for a complex tool. Slightly verbose, so not a perfect 5.

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?

The description covers the tool's purpose, use cases, alternatives, limitations, edge types, performance, and requirements. An output schema exists, so return value details are optional, but the description still briefly summarizes the return list. It is fully complete for an AI agent to select and invoke correctly.

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

Parameters3/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's Args section repeats the schema descriptions (name, project_root, max_depth, limit) but adds no new syntax or semantic detail beyond what the schema already provides about image and variant. It is adequate but does not elevate beyond baseline.

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 opens with a specific verb and resource: 'Find all transitive C/C++ callers'. It clearly distinguishes from siblings by naming alternatives: 'For a flat, single-level caller list use find_callers (faster). For the reverse direction use find_callees_recursive.' The scope (direct and indirect through libclang call graph) is explicit.

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?

Use case is stated directly: 'Use for impact analysis: if I change this function, how far does the ripple go?' It provides explicit when to use alternatives (find_callers for flat, find_callees_recursive for reverse) and even suggests verification tools when ambiguous resolution is suspected. This is exemplary guidance.

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