gograph_errors
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
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Optional keyword to filter the returned error structures (e.g., 'ErrInvalid', 'unauthorized') | |
| no_tests | No | Exclude error sites in *_test.go files |