gograph_coupling
Report package fan-in, fan-out, and instability to evaluate Go package isolation and coupling, with optional package filters and Mermaid flowchart output.
Instructions
Report fan-in (Ca), fan-out (Ce), and instability I=Ce/(Ca+Ce) per package. 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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gograph_coupling"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| mermaid | No | Return Mermaid flowchart text instead of structured JSON | |
| package | No | Optional package name substring to filter results | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. | |
| 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. |