traverse_graph
Walk the dependency graph from a symbol or file using BFS/DFS to discover what reaches it within a configurable depth and token budget. Understand dependency chains by tracing incoming, outgoing, or both directions.
Instructions
Walk the dependency graph from a starting symbol or file using BFS/DFS, with a hard token budget on the response. Use when you want a structured "what reaches this from N hops away?" answer without committing to the call-graph or impact-radius shape. Read-only. Returns JSON: { start, direction, nodes: [{ id, kind, name, depth, edge_type, in_degree }], total_visited, truncated_by_depth, truncated_by_nodes, truncated_by_budget }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_symbol_id | No | Symbol ID to start from. Mutually exclusive with start_file_path. | |
| start_file_path | No | File path to start from. Mutually exclusive with start_symbol_id. | |
| direction | No | Direction of traversal (default outgoing — follow what the start node points to). | |
| max_depth | No | Maximum BFS depth (default 3). | |
| max_nodes | No | Maximum nodes to visit (default 100). | |
| edge_types | No | Restrict the walk to these edge types (default: all). | |
| token_budget | No | Approximate token cap on the response (default 4000). |