Skip to main content
Glama

gograph_plan

Read-onlyIdempotent

Creates a structured pre-edit plan for a target Go symbol: symbols to read first, covering tests, touched routes/env vars, and public-API or SQL risk. Use before multi-file refactors to scope changes.

Instructions

Generate a structured pre-edit plan for a target symbol: which symbols to read first, which tests cover them, which routes and env vars they touch, and whether the change is public-API or SQL-touching. 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; no side effects. Set with_context=true to inline full source+callers+callees for each symbol to inspect — eliminates follow-up gograph_context calls. WHEN TO USE: Before multi-file refactoring or architectural changes to understand scope upfront. NOT TO USE: For trivial single-line fixes; for post-edit verification (use gograph_review instead). RETURNS: JSON with inspect_first[], tests[], routes[], env[], and a risk object (public_api, touches_sql, etc.); with with_context=true, also includes inspect_contexts[] with full per-symbol bundles. Uncommitted modes compare declarations against HEAD, including selected untracked Go files. Traversal consumers refuse deleted declarations requiring historical caller evidence. Review instead includes changes --git HEAD declaration evidence and names unavailable historical callers, tests and risk. Incomplete comparisons and missing/ambiguous current identities remain errors. Rebuild before traversing newly added symbols.

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.
symbolNoThe name of the symbol you intend to modify (supports short name 'ValidateToken', dot-notation 'graph.Graph', or fully-qualified ID)
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.
uncommittedNoSet to true to generate a global plan for all currently uncommitted changes across the repository
with_contextNoIf set to true, bundles full context, source code, callers, callees, and architectural roles for each symbol to be inspected

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. Addedv1.5.3
  3. Removedv1.5.3
  4. Changed1 schema field changed
    • changedInput schema / properties / symbol / description
      Previous value: -"The name of the symbol you intend to modify (e.g., 'ValidateToken')"New value: +"The name of the symbol you intend to modify (supports short name 'ValidateToken', dot-notation 'graph.Graph', or fully-qualified ID)"
  5. Changed3 schema fields changedv1.4.66
    • changedInput schema / properties / symbol / description
      Previous value: -"The symbol to plan changes for"New value: +"The name of the symbol you intend to modify (e.g., 'ValidateToken')"
    • changedInput schema / properties / uncommitted / description
      Previous value: -"Set to true to plan all uncommitted changes"New value: +"Set to true to generate a global plan for all currently uncommitted changes across the repository"
    • changedInput schema / properties / with_context / description
      Previous value: -"If true, include full context (source, callers, callees, role) for each inspect_first symbol"New value: +"If set to true, bundles full context, source code, callers, callees, and architectural roles for each symbol to be inspected"
  6. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent/non-destructive, and the description adds real behavioral context on top: the server checks and refreshes graph freshness before the call, precise modes retry CHA/SSA after source changes, uncommitted modes compare against HEAD including untracked Go files, and traversal consumers refuse deleted declarations. The later sentences about review/incomplete comparisons are dense and somewhat ambiguous, which keeps it from a 5.

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

Conciseness3/5

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

Purpose and the WHEN/NOT TO USE routing are well front-loaded, but the middle and tail are crowded with mode-specific prose ('Traversal consumers refuse deleted declarations...', 'Review instead includes changes --git HEAD declaration evidence...') that is hard to parse and partly duplicates sibling-tool description territory.

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 no output schema, the description carries the return shape itself and does so concretely (inspect_first[], tests[], routes[], env[], risk object, optional inspect_contexts[]). It also covers error conditions and mode semantics; the remaining gap is that root/session prerequisites are documented only in the schema, not the description.

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 baseline is 3; the description still adds meaning beyond the schema by explaining that with_context=true bundles full source/callers/callees per symbol and eliminates follow-up calls, and that uncommitted=true produces a repo-wide plan for all uncommitted changes. It does not add much for symbol, root, intention, or session_id, which is why it is a 4 rather than 5.

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 concrete verb+resource ('Generate a structured pre-edit plan for a target symbol') and then enumerates exactly what the plan contains: inspect-first symbols, covering tests, routes, env vars, and risk flags. It explicitly separates itself from gograph_review, so an agent can route between the two without opening either 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 gives an explicit WHEN TO USE (multi-file refactoring or architectural changes) and NOT TO USE (trivial single-line fixes; post-edit verification, pointing to gograph_review). It also names a concrete alternative invocation pattern: set with_context=true to avoid follow-up gograph_context calls.

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