gograph_deps
List direct or full transitive import dependencies of a Go package to audit layering and map import chains.
Instructions
List the import dependencies of a named package. With transitive=false (default), returns only direct imports. With transitive=true, returns the full BFS closure of all transitive imports. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. WHEN TO USE: When auditing package layering, understanding what a package pulls in, or mapping import chains before removing a dependency. NOT TO USE: For reverse lookup of who imports the package (use gograph_dependents); for symbol-level call tracing (use gograph_callers/gograph_impact). RETURNS: JSON with direct[] and transitive[] import path arrays; {"found":false} when the package is not in the graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | The target package path or name to inspect (e.g., 'internal/search', 'internal/cli') | |
| transitive | No | If true, return the full transitive import closure via Breadth-First Search (BFS) |