visualize_graph
Open interactive dependency graphs in your browser to visualize file and symbol relationships in codebases. Customize layouts, colors, and granularity to analyze connections and understand project structure.
Instructions
Open interactive HTML graph in browser showing file/symbol dependencies. Supports force/hierarchical/radial layouts, community coloring. Use granularity=symbol to see individual functions/classes/methods as nodes instead of files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | Scope: file path, directory (e.g. "src/"), or "project" | |
| depth | No | Max hops from scope (default 2) | |
| layout | No | Graph layout algorithm (default force) | |
| color_by | No | Node coloring strategy (default community) | |
| include_edges | No | Filter edge types (default: all) | |
| output | No | Output file path (default: /tmp/trace-mcp-graph.html) | |
| hide_isolated | No | Hide nodes with no edges (default: true — removes disconnected ring) | |
| granularity | No | Node granularity: file (default) or symbol (functions/classes/methods) | |
| symbol_kinds | No | Filter symbol kinds when granularity=symbol (e.g. ["function","class","method"]) | |
| max_files | No | Max seed files for file-level graph (default 10000) | |
| max_nodes | No | Max viz nodes for symbol-level graph (default 100000) |