Skip to main content
Glama

gograph_errors

Read-onlyIdempotent

Find all error creation sites in Go code, including errors.New, fmt.Errorf, and sentinel variable declarations. Filter by message text to catalog error codes or check if an error string is already defined.

Instructions

Find all error creation sites in the codebase: errors.New, fmt.Errorf, and sentinel var declarations. 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 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')
no_testsNoExclude error sites in *_test.go files
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint. The description adds valuable context: '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.' This goes beyond what annotations provide. No contradiction.

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?

The description is well-structured: starts with core purpose, then details freshness behavior, then optional filter, then usage guidance, then return value. Every sentence adds value, though it could be slightly more concise.

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?

Despite no output schema, the description clearly states return type: 'List of error creation sites with message text, file path, and line number; empty when no matches found.' It also explains freshness/retry behavior and optional filtering. Given the tool's simplicity, this is complete.

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 description coverage is 100% (both 'term' and 'no_tests' are described in schema). The description adds example values for 'term' (e.g., 'ErrInvalid', 'unauthorized'), which is helpful but not extensive. The 'no_tests' parameter is not mentioned in the description, so the value added is marginal.

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 explicitly states what the tool does: 'Find all error creation sites in the codebase: errors.New, fmt.Errorf, and sentinel var declarations.' It uses a specific verb 'Find' and resource 'error creation sites'. It also distinguishes from sibling tool gograph_errorflow, which handles 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?

The description includes a clear 'WHEN TO USE' section listing use cases (cataloging error codes, standardizing messages, checking existence) and a 'NOT TO USE' section naming the alternative sibling (gograph_errorflow for tracing propagation).

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