Skip to main content
Glama

gograph_errorflow

Read-onlyIdempotent

Trace a named Go error sentinel or message string from definition and return sites through propagation paths to HTTP handlers or CLI entry points.

Instructions

Trace how a named error sentinel or error message string is defined, returned, and propagates up the call graph toward HTTP handlers or CLI entry points. 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. Accepts either query (preferred) or term as the error name or message substring. WHEN TO USE: When auditing how a specific error is produced and handled end-to-end — find definition sites, all return sites, and upstream propagation paths (e.g., ErrNotFound). NOT TO USE: For general upstream traversal of any function (use gograph_callers or gograph_impact); for listing all error definitions (use gograph_errors). RETURNS: Definition sites, return sites, propagation path chains, and related test names; paths is empty when no propagation chain is found. Note: heuristic analysis — does not perform SSA or full data-flow tracking.

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.
termNoThe error string or sentinel error name (e.g., 'ErrInvalidToken' or 'invalid token')
queryNoThe error string or sentinel error name (preferred over term)
no_testsNoIf true, exclude test files from related-test collection (matches CLI --no-tests)
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. Addedv1.5.3
  3. Removedv1.5.3
  4. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations it discloses non-obvious behavior: a freshness check with refresh in the requested analysis mode, CHA/SSA retry after source changes in precise/precise_fallback graphs, and the heuristic caveat that no SSA or full data-flow tracking is performed. The 'read-only; no side effects' line repeats the annotations, but the added operational detail far outweighs that redundancy.

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 cleanly sectioned into WHEN TO USE, NOT TO USE, and RETURNS. Dense and largely earning its space, though the retry/analysis-mode sentence is heavy for a read tool and the side-effects line duplicates annotations.

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

Completeness5/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 fully covers returns: definition sites, return sites, propagation path chains, related test names, and the empty-paths case. It also flags the analysis-fidelity limit, so an agent knows what the result can and cannot prove.

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 coverage is 100%, so parameter meaning is already documented. The description adds only the query-over-term preference, which is a useful but narrow increment over the schema's own '(preferred over term)' note. Baseline 3 applies when the schema carries the parameter burden.

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 (trace) and resource (a named error sentinel or message string) with scope: definition sites, return sites, and upward propagation to HTTP/CLI entry points. It names the sibling tools it is not (gograph_callers, gograph_impact, gograph_errors), so an agent can distinguish it 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?

Explicit WHEN TO USE section frames the end-to-end error audit use case with a concrete example (ErrNotFound), and NOT TO USE names the exact alternatives for general upstream traversal and for listing all errors. Both the use and the exclusion conditions are spelled out.

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