Skip to main content
Glama

Explain a diagnostic code

explain
Read-onlyIdempotent

Look up an E_/W_ diagnostic code in the catalogue: what it means, why it is raised and how to resolve it, with an example that raises it and, for most codes when the installed core has them, fixed, the same example corrected. Returns { ok:true, code, entry: { code, severity, message, cause, fix, example, fixed? } }, the explain --json of the CLI; an unknown code returns { ok:false, code }. The code is matched case-insensitively.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesA diagnostic code, e.g. E_ROOM_SIZE or W_DOOR_CLEARANCE.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/closed-world annotations, the description discloses the exact return contract (ok, code, entry with severity, message, cause, fix, example), the failure mode for an unknown code ({ ok:false, code }), the conditional presence of `fixed` depending on the installed core, and case-insensitive matching. These are behavioral facts the annotations cannot express and that materially change how an agent should parse the response.

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 purpose is front-loaded in the first clause, followed by return shape and edge-case behavior, with no filler sentences. The inline return-object notation is dense but justified since no output schema exists to carry it. Slightly long as a single unbroken paragraph.

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?

With no output schema, the description takes on the full burden of describing the response and does so, including the success shape, the unknown-code shape, and the optional `fixed` field. For a single-parameter lookup tool, nothing an agent needs to call it correctly is missing.

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 coverage is 100% and the parameter already carries an example value, so the baseline is 3. The description still adds real meaning by stating the accepted prefix families (E_/W_) and that matching is case-insensitive, which tells the agent it need not normalize casing before calling.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Look up an E_/W_ diagnostic code in the catalogue', then enumerates what the lookup yields (meaning, cause, resolution, example, corrected example). It is easy to separate from a mutation-oriented sibling like 'fix' because this tool only retrieves and never applies anything. It stops short of naming a sibling explicitly, which keeps it from a 5.

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 is implied by the input contract: call this when you hold an E_ or W_ diagnostic code and need to understand or resolve it. There is no explicit 'use X instead when...' routing, nor a stated precondition such as needing a compiled/installed core. An agent can infer the trigger but must supply the alternatives itself.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources