Skip to main content
Glama

gograph_api

Read-onlyIdempotent

Detects public API drift by comparing exported Go symbols against a Git baseline or saved graph, helping catch breaking changes before releases or merges.

Instructions

Detect public API surface drift by comparing exported Go symbols between the current working tree and a baseline. A since value ending in .json loads a regular saved graph inside the project root with no linked path component and the exact current repository source-policy marker; its serialized root is ignored. Otherwise gograph validates the value as a Git ref and uses git archive to build a temporary baseline. 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 apart from reading the selected graph or extracting a temporary archive that is removed after the call. WHEN TO USE: Before releasing or merging a PR to catch breaking-change regressions — exported symbols added, removed, or renamed since the baseline. NOT TO USE: For listing current exports without a diff baseline (use gograph_public or gograph_skeleton instead). RETURNS: JSON with baseline and breaking flags; nested exported_symbols, interfaces, structs, and routes groups containing added/removed arrays plus changed detail objects; affected_tests, affected_mocks, and findings arrays. Empty groups indicate no drift.

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.
sinceYesA baseline Git ref (for example 'main' or 'HEAD~1') or regular in-project saved graph path ending in .json, with no linked component and the exact current source-policy marker
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.

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 / since / description
      Previous value: -"The baseline git reference (e.g., 'main' or 'HEAD~1') to compare against"New value: +"A baseline Git ref (for example 'main' or 'HEAD~1') or regular in-project saved graph path ending in .json, with no linked component and the exact current source-policy marker"
  3. Addedv1.5.4
  4. Removedv1.5.3
  5. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, and the description is consistent with them: "Read-only apart from reading the selected graph or extracting a temporary archive that is removed after the call" clarifies exactly what touches disk and that the archive is cleaned up. It adds real context beyond the annotations (freshness check before the call, refresh in the requested analysis mode, CHA/SSA retry for precise modes), though the sentence about the .json baseline's "linked path component" and "source-policy marker" is too opaque to be actionable.

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 core action, then clearly labeled WHEN TO USE / NOT TO USE / RETURNS blocks, which makes it quick to scan. It runs long and the middle sentences about .json baselines and precise_fallback retries are dense, though each does carry behavioral information rather than filler.

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?

For a four-parameter tool with full schema coverage and clear safety annotations, the definition covers purpose, triggers, exclusions, side effects, and the return shape (baseline/breaking flags, added/removed arrays, affected_tests, affected_mocks, findings, and the empty-groups convention). The only shortfall is the unexplained source-policy/linked-component constraint on .json baselines, which an agent cannot act on as written.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description earns a bump by explaining the two-mode behavior of `since` beyond the schema text: a .json path loads a saved graph and its serialized root is ignored, while any other value is validated as a Git ref and expanded via git archive into a temporary baseline. The `root` and `session_id` parameters are not discussed in the description, but the schema already covers them thoroughly.

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?

States a specific verb and resource: "Detect public API surface drift by comparing exported Go symbols between the current working tree and a baseline." It also explicitly names the siblings it is not (gograph_public, gograph_skeleton) for the no-baseline case, so an agent can route correctly without opening a 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?

Provides an explicit WHEN TO USE (before releasing or merging a PR to catch breaking-change regressions: exported symbols added, removed, renamed) and an explicit NOT TO USE with the alternative tools named. Both the trigger and the exclusion are stated, leaving nothing to inference.

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