Skip to main content

get_call_graph

Transitive caller and/or callee graph for a method symbol, depth-bounded with cycle detection. Output is an adjacency-list dict per direction (callees and/or callers), where each visited symbol maps to its outgoing edges. Direction: 'callees' (what this method transitively calls), 'callers' (who reaches this method), or 'both'. External (BCL/NuGet) callees appear as terminal leaves with isExternal=true. Declared signature only on callee side — no virtual dispatch resolution; agent uses find_implementations separately if needed. Callers side resolves dispatch naturally via Roslyn SymbolFinder. Hard cap on total visited nodes (default 500) — sets truncated=true if hit; edges to truncated targets are still recorded against the source node. Use this instead of recursive find_callers / analyze_method calls when you need depth > 1.

Parameters

ParameterTypeRequiredDescription
symbolstringMethod symbol (e.g. 'Greeter.Greet' or 'MyNamespace.MyClass.MyMethod')
directionstring'callees' (default), 'callers', or 'both'.
maxDepthintMax traversal depth from root. Default 3.
maxNodesintHard cap on total visited nodes. Default 500.