Skip to main content
Glama

review_sonar

Read-onlyIdempotent

Inspect a PR/MR and its Sonar quality gate, coverage, duplication, issues, and hotspots together; explain failures and optionally fix code. Reads evidence, so rerun Sonar to confirm fixes.

Instructions

Inspect a PR/MR and its Sonar quality gate, coverage, duplication, issues and hotspots together. The assistant explains failures and, when asked, fixes code using its local editing/testing tools. Supply ruleKey for remediation details or filePath (and lines) for source context. Use review_work read for the diff. This tool reads evidence; a new Sonar analysis is needed to confirm a fix.

Input Schema

NameRequiredDescriptionDefault
fullNoRaw Sonar responses instead of the compact view
pageNo
linesNoLine range of filePath, e.g. "40-90"
targetYes
projectNoSonar project key; defaults to configuration
ruleKeyNo
filePathNoOptional repository-relative file to inspect at the PR head

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.4.0
    • addedInput schema / properties / full
      Added value: +{
      +  "default": false,
      +  "description": "Raw Sonar responses instead of the compact view",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / lines
      Added value: +{
      +  "description": "Line range of filePath, e.g. \"40-90\"",
      +  "pattern": "^\\s*\\d*\\s*-?\\s*\\d*\\s*$",
      +  "type": "string"
      +}
  2. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare the safe read profile (readOnly, idempotent, non-destructive), so the bar is lower, yet the description still adds real context: it notes this tool 'reads evidence' and that a new Sonar analysis is needed to confirm a fix, which clarifies the read-only, non-verifying nature. It does not contradict the annotations and adds useful caveat context beyond them.

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?

Purpose is front-loaded in the first sentence and the parameter/alternative guidance follows efficiently. The sentence about the assistant fixing code with local editing tools is slightly tangential to tool selection but still frames how the tool fits into a workflow.

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 7-parameter, nested-object tool with no output schema, the description covers purpose, sibling routing, key parameter usage, and the read-only/verification caveat. It omits pagination and return-shape detail, but given the compact-view intent and existing annotations, nothing critical to correct invocation 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 only 57%, so the description must compensate, and it does for the key gaps: it explains ruleKey (remediation details) and filePath with lines (source context), which are the least-documented parameters. It leaves page/full behavior to the schema, keeping the added meaning focused rather than exhaustive.

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 description names a specific verb (inspect) and resource (PR/MR plus its Sonar quality gate, coverage, duplication, issues, hotspots), and explicitly carves out the boundary with the sibling review_work for the diff. An agent can distinguish this from review_work without opening either schema.

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

Usage Guidelines4/5

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

It routes the agent to a concrete alternative ('Use review_work read for the diff') and gives the condition for parameter use (ruleKey for remediation, filePath/lines for source context). It stops short of a full when-to-use/when-not framing, e.g. it doesn't say when a review of the quality gate is not warranted.

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

Deploy Server

Other Tools