Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSymbol name to find transitive callees 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 provided, the description carries the full burden. It explicitly declares 'Read-only. No side effects.', discloses the prerequisite index requirement, documents deduplication by shortest distance, and calls out the ambiguous name resolution limitation. This is exceptionally transparent.

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

Conciseness5/5

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

Well-structured with clear sections (purpose, use case, edge types, limitation, alternatives, read-only note, args, returns). Every sentence earns its place, balancing thoroughness with clarity. No repetition or filler.

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 complex transitive dependency tool, the description covers all necessary context: purpose, usage, alternatives, edge types, limitations, prerequisites, parameters, and return format. It also differentiates from a large sibling list, making selection easy.

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 coverage is 100%, so baseline is 3. The description's Args section repeats four parameters but adds no new meaning beyond the schema; 'project_root: Auto-detected if omitted' and defaults are already in the schema. The two variant-related parameters are not mentioned in the description but are fully documented in the input schema.

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?

Opens with 'Find all transitive C/C++ callees' — a specific verb and resource. Clearly distinguishes from siblings like find_all_callers_recursive (reverse direction) and get_symbol_context (direct callees only), while also detailing edge types and the libclang mechanism.

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: 'Use for dependency analysis: what does this function depend on to do its job?' Provides direct alternatives: 'For direct callees only, get_symbol_context gives a faster flat list... For the reverse direction use find_all_callers_recursive.' Also advises verification via search_bodies when a missing callee is suspected.

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