trace_symbol_call_chain
Trace a function's full call chain across the codebase AST, recursively finding upstream callers and downstream callees to render an execution tree and Mermaid diagram.
Instructions
Traces deep execution paths across the codebase AST. Recursively discovers upstream callers (who calls symbol_name) and downstream callees (what symbol_name calls) up to max_depth, rendering an execution tree and Mermaid call diagram.
Behavior:
Read-only: Recursively traverses AST function call expressions; does not modify source code.
Idempotent: Deterministic call graph traversal.
100% Offline: Local AST analysis without external services.
Usage Guidelines:
When to use: Run when debugging execution flows, tracing data paths into a function, or seeing everything a complex method calls recursively.
Sibling Routing: For quick single-symbol blast radius scoring (0-100), use 'analyze_change_impact'. For module-level import relations, use 'query_module_dependencies'.
Returns: Markdown report containing recursive ASCII execution tree, caller/callee counts, and copy-pasteable Mermaid flowchart syntax.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | Maximum recursion depth for the call graph traversal (default: 3). | |
| symbol_name | Yes | Exact function or method name to trace across the codebase call graph. | |
| project_root | No | Root directory of the repository (default: current directory). | . |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |