Skip to main content
Glama

gograph_errors

Read-onlyIdempotent

Locate all error and panic sites in a Go codebase, including errors.New, fmt.Errorf, sentinel vars, and panic calls. Filter by message substring to catalog error codes or check existing strings.

Instructions

Find all error and panic sites in the codebase: errors.New, fmt.Errorf, sentinel var declarations, and panic calls. 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. Optional term filters by message substring (e.g., "ErrInvalid", "unauthorized"). WHEN TO USE: When cataloging error codes and panic paths, standardizing error messages, or checking whether a specific error string is already defined before adding a new one. NOT TO USE: For tracing how an error propagates up the call stack (use gograph_errorflow instead). RETURNS: List of error or panic sites with message text, file path, and line number; empty when no matches found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNoOptional keyword to filter the returned error structures (e.g., 'ErrInvalid', 'unauthorized')
limitNoMaximum rows per page; the byte budget may return fewer.
cursorNoOpaque next_cursor for the same graph snapshot and result selection.
no_testsNoExclude error sites in *_test.go files

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.7.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor for the same graph snapshot and result selection.",
      +  "maxLength": 128,
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "description": "Maximum rows per page; the byte budget may return fewer.",
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Addedv1.5.3
  3. Removedv1.5.3
  4. Changed1 schema field changed
    • addedInput schema / properties / no_tests
      Added value: +{
      +  "description": "Exclude error sites in *_test.go files",
      +  "type": "boolean"
      +}
  5. Changed1 schema field changedv1.4.66
    • changedInput schema / properties / term / description
      Previous value: -"Optional string to filter the errors"New value: +"Optional keyword to filter the returned error structures (e.g., 'ErrInvalid', 'unauthorized')"
  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 declare readOnly/idempotent/non-destructive, so the description's 'Read-only; no side effects' is partly redundant. It does add genuinely new behavioral context: the server checks freshness before the call, refreshes in the requested analysis mode, and precise/precise_fallback graphs retry CHA/SSA after source changes – useful preconditions an agent wouldn't infer from annotations.

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 purpose and clearly sectioned into WHEN/NOT/RETURNS blocks. The freshness/CHA-SSA sentence is somewhat dense and internal-mechanism heavy, but every part is scannable and earns its place for an agent deciding how to call it.

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 correctly carries the return-shape burden: it specifies the list contents (message text, file path, line number) and the empty-result case. Combined with usage and behavioral notes, an agent has everything needed to select and invoke it correctly.

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 term/limit/cursor/no_tests are already documented. The description restates the term filter with examples ('ErrInvalid', 'unauthorized') and implies pagination via 'empty when no matches found', but adds no semantics beyond the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Find') and resource ('error and panic sites'), then enumerates the exact patterns detected (errors.New, fmt.Errorf, sentinel var declarations, panic calls). It explicitly distinguishes itself from the sibling gograph_errorflow, so an agent can route correctly 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?

Provides explicit WHEN TO USE scenarios (cataloging error codes, standardizing messages, checking whether a string exists) and an explicit NOT TO USE clause pointing to the alternative gograph_errorflow for propagation tracing. When/when-not/alternative are all covered unambiguously.

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