Skip to main content
Glama

gograph_coupling

Read-onlyIdempotent

Assess package isolation by calculating fan-in, fan-out, and instability metrics for every package. Visualize dependencies and evaluate code coupling across your Go codebase.

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

NameRequiredDescriptionDefault
rootNoAbsolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean.
mermaidNoReturn Mermaid flowchart text instead of structured JSON
packageNoOptional package name substring to filter results
intentionNoTechnical rationale, required for analytical calls selecting an active session.
session_idNoCaller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.
internal_onlyNoRestrict 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_stdlibNoInclude standard-library packages in the report. Default false — users asking 'how coupled is my code?' rarely care about stdlib coupling.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.7.18
    • addedInput schema / properties / intention
      Added value: +{
      +  "description": "Technical rationale, required for analytical calls selecting an active session.",
      +  "type": "string"
      +}
    • addedInput schema / properties / root
      Added value: +{
      +  "description": "Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean.",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv1.5.6
    • addedInput schema / properties / mermaid
      Added value: +{
      +  "description": "Return Mermaid flowchart text instead of structured JSON",
      +  "type": "boolean"
      +}
  3. Addedv1.5.3
  4. Removedv1.5.3
  5. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish read-only, idempotent, non-destructive behavior, so 'Read-only; no side effects' adds nothing. The genuinely useful addition is that the server refreshes source analysis before the call, which signals freshness and latency cost, plus the note that coupling returns Mermaid text when mermaid=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the metric definition, then scope controls, then WHEN TO USE and RETURNS blocks. Efficient, though 'Read-only; no side effects' duplicates the annotations and is wasted space in an otherwise dense description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With seven optional parameters and no output schema, the description covers what is measured, scope controls, and the return format including the Mermaid variant. The main gap is that the session_id/intention parameters, which are non-obvious for analytical calls, get no mention in the description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description restates the surface semantics ('package filters by substring; include_stdlib and internal_only control scope') but does not add the nuanced relationship between internal_only and include_stdlib that the schema spells out, nor anything about root, session_id, or intention.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with named outputs: fan-in (Ca), fan-out (Ce), and instability I=Ce/(Ca+Ce) per package. It does not name overlapping siblings such as gograph_deps, gograph_imports, or gograph_boundaries, so the agent must infer the distinction from the definitions of those tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'WHEN TO USE: To evaluate package isolation' line gives a usage context but no exclusions or named alternatives, despite several siblings (gograph_deps, gograph_imports, gograph_boundaries) that could plausibly serve similar needs. The agent is told when, but not when not.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.