gograph_coupling
Reports fan-in, fan-out, and instability per Go package to evaluate package isolation. Use to identify tightly coupled packages and improve modularity.
Instructions
Report fan-in (Ca), fan-out (Ce), and instability I=Ce/(Ca+Ce) per package. The MCP server refreshes source analysis before the call. Read-only; no side effects. package filters by substring; include_stdlib and internal_only control scope. WHEN TO USE: To evaluate package isolation. RETURNS: Package coupling records; with mermaid=true, Mermaid flowchart text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mermaid | No | Return Mermaid flowchart text instead of structured JSON | |
| package | No | Optional package name substring to filter results | |
| internal_only | No | Restrict the report to the project's own packages (anything starting with the module path from go.mod). Strictly stronger than excluding stdlib — also excludes third-party deps. | |
| include_stdlib | No | Include standard-library packages in the report. Default false — users asking 'how coupled is my code?' rarely care about stdlib coupling. |