Skip to main content
Glama

find_call_path

Find call paths between two C/C++ functions using BFS on the libclang call graph. Returns up to 5 shortest paths with depth and chain, resolving function pointers and ISR vectors.

Instructions

Find call paths between two C/C++ functions via BFS in the libclang call graph, including function-pointer edges and ISR vector registrations. libclang-powered: follows function-pointer edges and ISR vector registrations that text-based search cannot resolve.

Use to answer "how does A reach B?" — e.g. tracing how a high-level event handler eventually calls a low-level driver. Returns up to 5 shortest paths, each with depth (edge count) and chain (e.g. "main → app_run → modem_init").

For one-sided exploration use find_all_callers_recursive (who reaches this?) or find_callees_recursive (what does this reach?). For exact call-graph verification use find_callers or find_references.

Read-only. No side effects. Requires both symbols to be in the index and refs enabled (fw-context index — refs on by default).

Args: from_name: Starting symbol for path search. to_name: Target symbol to find path to. project_root: Project root. Auto-detected if omitted. max_depth: Maximum BFS depth for path search (default 10).

Returns: list of dicts, each with: depth (edge count, int), chain (str — e.g. "main → app_run → modem_init"). Empty list when no path exists within the depth limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
to_nameYesTarget symbol to find path to.
from_nameYesStarting symbol for path search.
max_depthNoMaximum BFS depth for path search (default 10).
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?

No annotations are provided, so the description carries full burden. It declares read-only behavior with no side effects, explains the use of libclang to resolve function-pointer edges and ISR registrations, and details limitations (up to 5 shortest paths, empty list if no path within depth limit).

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 (capability, use case, alternatives, safety, parameters). It is slightly long but every part contributes value. No redundant sentences.

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?

Given the tool's complexity (BFS, function-pointer edges, multiple parameters), the description covers purpose, usage context, alternatives, side effects, parameters, return format, and prerequisites. It is thorough and leaves no critical gaps.

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% (all parameters described in schema). The description's Args section restates schema information with minor additions (e.g., auto-detection for project_root). While the description also explains the return format, an output schema exists, so this is redundant. Thus, minimal added value over schema, baseline 3.

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 finds call paths between two C/C++ functions using BFS, and distinguishes from sibling tools like find_all_callers_recursive and find_callees_recursive by specifying one-sided exploration use cases.

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?

The description explicitly states when to use the tool ('how does A reach B?') and provides alternatives for other scenarios (one-sided exploration). It also lists prerequisites (both symbols in index, refs enabled).

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