Skip to main content
Glama

find_callees_recursive

Finds all transitive callees of a C/C++ function by traversing the call graph, including indirect calls via function pointers, for dependency analysis.

Instructions

Find all transitive C/C++ callees — what name calls, directly or indirectly, through the libclang call graph including function-pointer 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.

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.
limitNoMaximum results (default 50).
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?

Discloses it is read-only with no side effects, requires the reference index, explains BFS depth traversal, deduplication by shortest distance, and output format. No annotations to contradict.

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?

Well-organized with purpose, use case, behavioral details, parameters, and return format. Front-loaded with main action. Slightly lengthy but efficient for the complexity.

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?

Covers algorithm, output specification, requirements, and comparisons with siblings. With output schema, description still provides necessary context for invocation.

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 covers all parameter descriptions (100% coverage). Description adds context linking max_depth to BFS depth and default values, but largely repeats schema info. Still provides useful behavioral context beyond 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?

Clearly states the tool finds transitive C/C++ callees using libclang call graph, including function-pointer edges. Distinguishes itself from sibling tools like get_symbol_context (direct callees only) and find_all_callers_recursive (reverse direction).

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 recommends for dependency analysis and provides alternatives: use get_symbol_context for direct callees only, and find_all_callers_recursive for the reverse direction.

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