Skip to main content
Glama

gograph_diagram

Read-onlyIdempotent

Generate a Mermaid architecture diagram of a Go package dependency graph. Use grouping and depth options for onboarding, architecture reviews, or large monorepos.

Instructions

Refresh source analysis and generate a Mermaid architecture diagram of the package dependency graph. Read-only; no side effects. WHEN TO USE: Onboarding, architecture review, or communicating package structure. Use group_by=module for monorepos and group_by=file for drill-downs. NOT TO USE: For call-graph traversal or single-package focus. RETURNS: Mermaid text; use max_depth or coarser grouping for large graphs.

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_diagram"
  }
}

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.
group_byNoGrouping level: 'package' (default), 'module', 'service', or 'file'
intentionNoTechnical rationale, required for analytical calls selecting an active session.
max_depthNoMaximum BFS depth from graph roots (0 = unlimited)
session_idNoCaller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.
include_stdlibNoIf true, include Go standard library packages in the diagram

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
    • changedInput schema / properties / max_depth / type
      Previous value: -"number"New value: +"integer"
  3. Addedv1.5.3
  4. Removedv1.5.3
  5. Added

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already establish readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so "Read-only; no side effects" largely restates structured data. The description does add behavior the annotations cannot express: it returns Mermaid text rather than a file, and it discloses a scale caveat (use max_depth or coarser grouping for large graphs). What it omits is whether "refresh source analysis" triggers an index rebuild and how long that takes, which matters for a tool whose name implies work beyond formatting.

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

Conciseness5/5

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

Four sentences, front-loaded with the core action before the labeled WHEN TO USE, NOT TO USE, and RETURNS sections. The labeled structure makes it scannable, and no sentence is filler — even the scale caveat prevents a foreseeable failure.

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 six optional parameters, no required inputs, and no output schema, the description adequately covers purpose, selection, tuning, and return type (Mermaid text). The remaining gap is operational: it never mentions that regenerating analysis may take time or that output size is bounded, leaving the agent to discover volumetrics on large repos by trial.

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?

Every parameter is documented in the schema at 100% coverage, so the baseline is 3 and the schema carries most of the semantic load. The description only adds scenario-level meaning for group_by (module vs file) and max_depth (large graphs); root's worktree constraint, session_id, intention, and include_stdlib are left entirely to the schema.

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

Purpose5/5

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

The description opens with a specific verb and resource: "Refresh source analysis and generate a Mermaid architecture diagram of the package dependency graph." It also explicitly excludes sibling territory ("call-graph traversal or single-package focus"), so an agent can separate it from gograph_deps, gograph_callers, or gograph_explore without reading any schema.

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

Usage Guidelines5/5

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

It provides explicit positive triggers (onboarding, architecture review, communicating package structure) and explicit negative scope ("NOT TO USE: For call-graph traversal or single-package focus"). It further routes parameter choice by scenario — group_by=module for monorepos, group_by=file for drill-downs — which is decision guidance rather than mere option listing.

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