What it does
errorcatalog scans source text line by line for throw statements of the form new Error(...), where the type name ends in Error, such as Error, TypeError, RangeError or a custom type like FooError. For each throw site it records the file, the 1-based line, the error type and the message. A message is literal when the first argument is a plain quoted or backtick string without a template expression, and it is recorded exactly as written. Any other first argument, such as a template with a substitution, an identifier, a call or a concatenation, is dynamic and its message is null. A throw with no argument is recorded with a note saying so. Throws that are not new Error(...) are not catalogued, and duplicate throws remain separate entries.
The tool suits a review of which errors a codebase can raise and whether their literal messages are documented. When documentation texts are supplied, each literal message is checked verbatim against them and marked documented or undocumented. Dynamic and no-message entries get no documented value. Without documentation the result reports docs_provided as false and both documented counts as 0.
The analysis is local text processing with no network or filesystem access in the core. A command-line interface reads sources.json and an optional docs.json, each a JSON array of path and content objects, and prints the catalog as JSON. An MCP server exposes a catalog_errors tool that takes required sources and optional docs and returns the errors and counts. The package is released under the MIT licence.
Limitations and requirements
Only the first line of a throw statement is inspected, so a literal whose argument list spans several lines is catalogued as dynamic; this is stated as a deliberate design choice. Unreadable or invalid JSON files and malformed entries cause a runtime error (exit code 1), and the error names the offending path. The CLI also returns exit code 2 on a usage error.
Safety
Our team has not reviewed this resource. Only automated rules checked it; resources with high-risk signals are not published. These are signals, not a guarantee that installing it is safe. Try it in a sandbox project first.
- Runs code or changes an assistant's behaviour
Sources
- Official MCP Registry first seen 13 Nov 2026 · last seen 13 Nov 2026 · its page on the source
io.github.CloudCorpRecords/errorcatalog
Catalogue every error a codebase throws, and whether each message is documented.
v0.1.0As shown on registry.modelcontextprotocol.io when we last read it