Build a Call Graph
call_graphBuilds a depth-limited call graph rooted at a method, traversing callees or callers to reveal call relationships and safely handle cycles.
Instructions
Build a depth-limited call graph rooted at a method NAME: direction='callees' follows project-internal calls outward, 'callers' the inverse (who calls this). Returns root, direction, maxDepth and (caller, callee) edges using method-lookup keys, cycle-safe and capped at 500 edges (truncated flag). A creation (new X(...)) is an edge to the constructor it binds, keyed 'Ns.X.X(params)', and both directions walk on through constructors: into what one calls and creates, out to the code creating the object. A local function's key ends in '@::', character offsets, not a line ('localFunctionKeyNote' repeats this when the answer holds one). A bare name roots EVERY same-named declaration and the graph is their union (a common name like 'ExecuteAsync' pulls in unrelated members); 'Type.Method' roots only that type's declarations of the name, overloads included. With direction='callers' every node also brings in the callers of the interface and abstract members it implements, at every hop as impact_of_change does (a call through a contract is recorded on it); 'viaContract' names those members with their implementation counts (one: exact, several: a union) and the nodes that brought them in ('creditedBy'). 'generatedStops' counts the generated documents (' (generated)') among the callers; the walk stops at them. 'generatedInvokers' names the walked methods generated code invokes without being their recorded caller (a [RelayCommand] method). 'rootedAt' lists the declarations actually walked: check it when the result looks too big (re-query a rarer or qualified name) and when it is empty (the name resolved to nothing, which an empty edge list does not tell). Optional: 'note' (on a callers walk, callers in unread VB or F# code are missing; for an empty rootedAt, unread VB, F# or markup code may declare the name) and 'nearest' (a close declared method name for an empty rootedAt).
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": {
"sessionId": "<sessionId>",
"method": "<method>"
},
"name": "call_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Max traversal depth (1-10). Default 2. | |
| method | Yes | The root method's name, bare or as 'Type.Method'. | |
| direction | No | 'callees' (default) or 'callers'. | callees |
| sessionId | Yes | The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. |