trace_path
Trace connectivity and multi-hop paths across codebase architecture to map blast radius, find shortest or safest routes, and verify transitive layering.
Instructions
Trace connectivity and multi-hop paths across the codebase architecture. Use this read-only tool to map blast radius, find shortest paths, or verify transitive layering. Use this instead of query_graph or inspect_symbol when you need to prove deep, multi-hop relationships between specific components. The tool operates in five distinct modes: shortest (finds semantic or strict AST paths between source and target), safest (finds the path with highest aggregate confidence), transitive_forward (downstream reachability), transitive_reverse (upstream callers), and module_dependencies (cross-module edges). Returns a structured Markdown report detailing the traced paths, confidence scores, and edge relations. Traversal halts when depth is reached, and output is truncated to fit the budget.
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": {
"source": "<source>"
},
"name": "trace_path"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Routing mode: 'shortest' (default), 'safest', 'transitive_forward', 'transitive_reverse', or 'module_dependencies'. | |
| depth | No | Maximum traversal depth for transitive modes (default 3, max 6). | |
| budget | No | Approximate output character budget for transitive modes (default 2000). | |
| source | Yes | Starting node ID or label. For module_dependencies, this is the source module or directory path fragment. | |
| target | No | Destination node ID or label. Required for shortest, safest, and module_dependencies modes. For module_dependencies, this is the target module or directory path fragment. | |
| direction | No | Optional direction override for transitive modes: 'forward', 'reverse', or 'both'. | |
| path_mode | No | Shortest path strategy: 'semantic' (default) prefers calls, uses, and contains style relations; 'strict' uses the exact fewest hops. | |
| node_types | No | Optional file types to include for shortest paths, for example ['code', 'document', 'rationale']. | |
| path_prefix | No | Optional path prefix or path fragment to include for shortest paths (case-insensitive). | |
| exclude_path | No | Optional path prefix or path fragment to exclude for shortest paths (case-insensitive). | |
| ast_only_tuning | No | AST-only tuning for shortest paths: true enables AST-only noise suppression, false disables it, omitted = auto. | |
| exclude_relations | No | Optional relation filters to exclude for shortest paths, for example ['imports']. | |
| include_relations | No | Optional relation filters to include for shortest paths, for example ['calls', 'uses']. | |
| generated_code_mode | No | Generated-like code filter for shortest paths: 'include' (default), 'exclude', or 'only'. | |
| exclude_framework_noise | No | Exclude framework and import-noise bridge nodes from shortest path search. Default false. |