Skip to main content
Glama

explain_exception

Explains what a common exception means and its three most common causes. Use it to see what to check first when a trace shows KeyError, NullPointerException, or similar errors.

Instructions

Explain a common exception type: what it means, its three most common causes, what to check first.

Covers about 80 exceptions across Python, Node, Java/Kotlin, Go, Rust and .NET (for example KeyError, ECONNREFUSED, NullPointerException, "concurrent map writes", "unwrap on None", NullReferenceException). Package prefixes are ignored (java.lang.NullPointerException = NullPointerException).

Args: type: Exception name or distinctive message, e.g. "KeyError", "java.lang.OutOfMemoryError", "nil pointer dereference". language: Optional: python, node, java, go, rust or dotnet. Omit to search all.

Input Schema

NameRequiredDescriptionDefault
typeYes
languageNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses coverage (~80 exceptions across six runtimes), name-normalization behavior (package prefixes ignored, with a worked example), and the shape of the answer. It omits the failure mode when a type is unrecognized and any rate/limit or caching behavior.

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, then coverage scope, then args in a conventional docstring block. The runtimes-plus-examples list is slightly long but each example teaches name normalization, so little is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description needn't detail return values, yet it usefully previews the answer contents. For a 2-param lookup tool this is nearly complete; the only meaningful gap is behavior for exceptions outside the ~80 supported or with an unsupported language value.

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?

Schema description coverage is 0%, so the description must compensate, and it does: 'type' is illustrated with three concrete formats including a fully qualified name, and 'language' is given an explicit valid value list (python, node, java, go, rust, dotnet) plus the semantic of omitting it. It falls short of saying what the matching tolerance is, i.e. how distinctive a raw message fragment may be.

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 first sentence gives a specific verb and resource ('Explain a common exception type') and enumerates the return contents: meaning, three most common causes, what to check first. This is clearly distinct from siblings like parse_trace, fingerprint or map_to_code, which operate on traces rather than exception semantics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied rather than stated: the agent can infer this is for interpreting a known exception name or message. It never says when to prefer it over a sibling or what to do when the exception is unknown, though 'Omit to search all' gives clear guidance for the language parameter.

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