Skip to main content
Glama

explain_rule_result

Read-only

Explain why a rule did or did not fire on a document: whether its formats matched, what its given matched, what then checked, and the verdict. Works for your own rules, the catalog, and the built-ins.

Input Schema

NameRequiredDescriptionDefault
ruleYesA rule id, e.g. "info-require-license" or "operation-operationId".
contextNoOptional: why you are asking. One sentence — the task you are trying to complete, or what you expect to get back. Never included in the answer and never used to rank; it is read only when a result turns out to be wrong, which is when knowing the intent is what makes the report actionable.
documentYesThe API description to operate on — OpenAPI, AsyncAPI, Arazzo or JSON Schema. A YAML/JSON string or an already-parsed object; both are accepted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint=false; the description adds that the explanation includes concrete internals (format matching, `given` matching, `then` checks, verdict) and that it works across owned, catalog, and built-in rules, which tells the agent there is no ownership prerequisite. No mention of limits or failure modes, but with no output schema this enumeration carries real weight.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero filler: the purpose and payload are front-loaded, and the scope sentence follows. Every clause (formats, given, then, verdict, rule sources) conveys distinct information.

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?

With no output schema, the description usefully enumerates the report's contents and the rule sources it handles, which is what an agent needs to decide to call it. Minor gaps remain—e.g., what happens if the rule id is unknown or the document fails to parse—but the core calling information is present.

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% and all three parameters—including the optional `context` field—are documented in the schema itself. The description adds only that the operation targets a document and a rule, restating what the schema already says; 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 (Explain) and precise resource (why a rule did or did not fire on a document), then enumerates exactly what the explanation covers: formats matched, what `given` matched, what `then` checked, and the verdict. The scope sentence (own rules, catalog, built-ins) further separates it from describe_rule and test_ruleset.

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 by the diagnostic framing—an agent will infer it is for debugging an unexpected pass/fail—but there is no explicit when-to-use/when-not guidance and no named alternatives such as describe_rule or test_ruleset. The scope sentence ('Works for your own rules, the catalog, and the built-ins') widens applicability but does not route the agent.

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