trace_calls
Trace callers and callees around a function, or find a call path between two functions, to answer questions about how code calls are connected.
Instructions
Traces the call graph around one function, hop by hop: function is a function or method name, direction in lists who calls it, out lists what it calls; with to it returns a call path from the function to that other one. Use it for questions about calls only: for every kind of use of a name (imports, types, references and calls) use find_usages. When the graph holds no call edge for the function, the answer gives the links between the modules instead and says so. depth is 2 hops by default, 5 for a path. Returns one line per caller, callee or step. A long list stops at 200 items unless all is true. A name the graph does not hold is answered with an error line, with suggestions when similar names exist.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"function": "<function>"
},
"name": "trace_calls"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Another function: the answer is a call path from `function` to it. | |
| all | No | List everything instead of stopping at 200 items. | |
| depth | No | How many hops to follow (default 2; 5 for a path with `to`). | |
| function | Yes | Function or method name; literal text with optional .* wildcards. | |
| direction | No | in: who calls the function; out: what the function calls. Not used with `to`. | in |