Skip to main content
Glama

gograph_errors

Read-onlyIdempotent

Find all error creation sites (errors.New, fmt.Errorf, sentinel var declarations) in a Go codebase. Filter by error message substring to check if an error string already exists.

Instructions

Find all error creation sites in the codebase: errors.New, fmt.Errorf, and sentinel var declarations. Requires .gograph/graph.json — run gograph build . first. Read-only; no side effects. Optional term filters by error message substring (e.g., "ErrInvalid", "unauthorized"). WHEN TO USE: When cataloging error codes, 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 creation 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')
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds prerequisite information (requires .gograph/graph.json and running 'gograph build .' first) and explicitly states 'Read-only; no side effects'. This provides useful behavioral context beyond annotations, though the safety profile is already well-covered.

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?

The description is four sentences with explicit sections (prerequisite, safety, parameter usage, when to use, returns). Every sentence serves a purpose with no fluff or redundancy.

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?

Given no output schema, the description clearly states the return format (list with message text, file path, line number) and behavior (empty when no matches). It also covers prerequisite, safety, and parameter usage, making it fully self-contained for agent decision-making.

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?

The single parameter 'term' has 100% schema coverage. The description adds value by explaining it filters by error message substring and provides concrete examples ('ErrInvalid', 'unauthorized'), which goes beyond the schema's generic description.

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 clearly states it finds error creation sites including errors.New, fmt.Errorf, and sentinel var declarations. It uses a specific verb ('Find') and resource ('all error creation sites in the codebase'), and distinguishes from the sibling tool gograph_errorflow, which traces error propagation.

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 (cataloging error codes, standardizing messages, checking for existing errors) and NOT TO USE section (not for tracing propagation, with alternative gograph_errorflow). Provides clear context for when to select this tool over siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ozgurcd/gograph'

If you have feedback or need assistance with the MCP directory API, please join our Discord server