visualize_graph
Open an interactive HTML graph in the browser to visualize file or symbol dependencies with layouts like force, hierarchical, or radial.
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. Writes an HTML file to disk. For static Mermaid/DOT output use get_dependency_diagram instead. Returns JSON: { outputPath, nodes, edges }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Max hops from scope (default 2) | |
| scope | Yes | Scope: file path, directory (e.g. "src/"), or "project" | |
| layout | No | Graph layout algorithm (default force) | |
| output | No | Output file path (default: /tmp/trace-mcp-graph.html) | |
| color_by | No | Node coloring strategy (default community) | |
| max_files | No | Max seed files for file-level graph (default 10000) | |
| max_nodes | No | Max viz nodes for symbol-level graph (default 100000) | |
| 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"]) | |
| hide_isolated | No | Hide nodes with no edges (default: true — removes disconnected ring) | |
| include_edges | No | Filter edge types (default: all) | |
| include_bottlenecks | No | Annotate edges with bottleneckScore/isBridge and nodes with isArticulation (file granularity only). Default false. |