Skip to main content
Glama

repopilot_explain_file

Read-onlyIdempotent

Explain how RepoPilot treats a file: its assigned role, evidence, applicable rules, override severity, and why a rule or signal fires or not without a scan report.

Instructions

Explain how RepoPilot treats one file: the role it assigns (for example test, generated, config, or CLI command handler) and the evidence for it, which rules apply, the ordered overrides that change a rule's severity, and whether the default profile would show the result. Use it to understand a file without a report, or to ask why a rule (rule, optionally one detector signal) would or would not fire there. To explain a finding already in a scan or review, use repopilot_explain_finding; for a review signal, use repopilot_explain_review_signal. Reads local files only and returns JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to explain.
ruleNoOptional rule ID (see the repopilot://rules resource) to focus the explanation on.
signalNoOptional detector signal within `rule` to focus on, e.g. "rust.todo" for language.rust.panic-risk.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.24.2
    • changedInput schema / properties / rule / description
      Previous value: -"Optional rule id to focus the explanation on."New value: +"Optional rule ID (see the repopilot://rules resource) to focus the explanation on."
    • changedInput schema / properties / signal / description
      Previous value: -"Optional signal id to focus the explanation on."New value: +"Optional detector signal within `rule` to focus on, e.g. \"rust.todo\" for language.rust.panic-risk."
  2. First observedv0.24.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered structurally. The description still adds real behavior: it reads local files only and returns JSON, and it discloses that overrides are ordered and can change a rule's severity — information that is not in the annotations. It does not detail pagination/limits, but for a read-only explainer that is minor.

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?

Three sentences, front-loaded with the primary purpose then the routing guidance. Dense but every clause carries information; the inline parenthetical role examples are the only slight padding, and they illustrate the output meaningfully.

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?

Output schema exists, so return values need not be described. The description covers purpose, scope (local files only), the optional narrowing parameters, and correct sibling routing, leaving no gap an agent would need filled before calling it.

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% so the baseline is 3, but the description adds meaning beyond the schema by framing `rule` and `signal` as a query ('ask why a rule would or would not fire there') and clarifying that `signal` narrows within `rule`. This ties the two optional parameters to a purpose, not just a type.

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 and resource ('Explain how RepoPilot treats one file') and enumerates exactly what the explanation contains: assigned role with evidence, applicable rules, ordered severity overrides, and default-profile visibility. It names the sibling tools it is not (repopilot_explain_finding, repopilot_explain_review_signal), so an agent can disambiguate without opening schemas.

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

Usage Guidelines5/5

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

Gives explicit use cases ('understand a file without a report', 'ask why a rule would or would not fire there') and explicit routing rules: use repopilot_explain_finding for a finding already in a scan/review and repopilot_explain_review_signal for a review signal. Both when-to-use and when-to-use-something-else are covered.

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