trace_calls
Trace call chains from or to any function, following direct calls and cross-process invocations to map dependencies and callers.
Instructions
Trace call chains from or to a function/method, following CALLS and CALLS_REMOTE edges transitively.
Use this when you need to:
"What does this function eventually call?" (forward) — full call tree including cross-language hops
"Who calls this function?" (backward) — all callers up the stack
"Show the full call chain from handler to database" (forward with depth)
Unlike trace_dataflow (which follows data assignments), this follows function CALLS edges:
CALLS: same-language function/method invocation
CALLS_REMOTE: cross-process/language boundary (IPC, HTTP, socket)
Returns: Indented call tree showing each hop with file:line location.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Function/method name or semantic ID to trace from | |
| file | No | File path to disambiguate (optional) | |
| direction | No | forward (callees), backward (callers), or both (default: forward) | |
| max_depth | No | Maximum chain depth (default: 10) |