Skip to main content
Glama

Explain rule

explain_rule
Read-only

Explains what a lint rule checks, its severity, formats, documentation link, and attached extensions such as fix guidance.

Instructions

Explains one rule: what it checks (description, message, given, then), its severity and formats, a documentation link, and extensions, free-form data the ruleset attached to the rule, such as guidance for fixing it (extensions.prompt).

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": {
      "rule": "<rule>"
    },
    "name": "explain_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
ruleYesThe rule name, as in a diagnostic code or list_rules
rulesetNoA ruleset name from list_rulesets (or oas, asyncapi, arazzo), or an inline YAML/JSON ruleset. Default: the default ruleset.
filenameNoA document name, such as "openapi.json", to include the rules the ruleset's overrides apply to it, as lint_document would. Never read. Default: document.yaml.

Output Schema

NameRequiredDescriptionDefault
nameYes
thenYes
givenYesJSONPath expressions; #Name refers to an alias of the ruleset
enabledYesWhether lint_document runs it
formatsYesFormats the rule declares; empty means all of the ruleset's
messageYesMessage template; {{error}} and similar are filled in per diagnostic
severityYes
extensionsYesFree-form data the ruleset attached, such as extensions.prompt
descriptionYes
recommendedYes
documentationUrlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds real value by explaining the `extensions` blob and pointing at `extensions.prompt` as fix guidance, but it does not note what happens when the rule or ruleset is unknown.

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?

One front-loaded sentence that puts the verb and resource first, then enumerates the returned pieces. Mild redundancy with the output schema, but no wasted phrasing.

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?

For a read-only, well-specified three-parameter tool with an output schema and full schema coverage, the definition covers everything an agent needs to call it correctly. The only shortfall is the absence of explicit guidance on using it versus the listing siblings.

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%, so rule, ruleset, and filename are already documented at the field level, including the note that filename is never read. The description adds no parameter meaning beyond restating that the subject is a single rule, so baseline 3 applies.

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?

States a specific verb ('Explains') plus a single resource ('one rule') and enumerates exactly what is covered: description, message, given, then, severity, formats, documentation link, and extensions. That is enough for an agent to distinguish it from list_rules/list_rulesets, which deal with many rules rather than one.

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 only implied by 'one rule' – the agent can infer this is the lookup-path for detail on a single rule. There is no explicit statement of when to use it instead of list_rules or list_rulesets, and no prerequisites are named.

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