Skip to main content
Glama

review_sonar

Read-onlyIdempotent

Inspect a PR/MR with its Sonar quality gate, coverage, duplication, issues, and hotspots; explain failures and guide code fixes, with rule or file context when needed.

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.

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": {
      "target": "<target>"
    },
    "name": "review_sonar"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullNoRaw Sonar responses instead of the compact view
pageNo
linesNoLine range of filePath, e.g. "40-90"
targetYesThe MR/PR: its URL, its number for the configured project, or { provider: "gitlab"|"github", project?, number }
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.5.0
    • addedInput schema / properties / target / description
      Added value: +"The MR/PR: its URL, its number for the configured project, or { provider: \"gitlab\"|\"github\", project?, number }"
    • changedInput schema / properties / target / properties / project / description
      Previous value: -"GitLab ID/path or GitHub owner/repository; defaults to configured GitLab project"New value: +"GitLab ID/path or GitHub owner/repository; defaults to the configured project"
  2. 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"
      +}
  3. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint, and destructiveHint=false, so safety is covered structurally. The description adds genuinely new behavior: this tool only reads evidence, fixes are performed outside it via local editing/testing tools, and results stay stale until a new Sonar analysis runs. It omits any mention of auth/permission requirements or pagination behavior for the page parameter.

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?

Five short sentences, front-loaded with what is inspected before routing and parameter hints. Nothing is padding, though the sentence about the assistant explaining failures and fixing code is slightly meta relative to the tool's own contract.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with a nested target object and no output schema, the description covers the evidence returned and the remediation workflow but does not describe pagination (page up to 1000), the full raw-response mode, or the output shape at a level an agent could plan around. It is adequate but leaves real gaps given the tool's complexity.

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 description coverage is 71%, and the description supplies intent for the two weakest spots: ruleKey's purpose (remediation details) and filePath/lines (source context), neither of which the schema explains semantically. It leaves page and full unaddressed, so it is helpful but not complete over the schema.

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 states a specific verb (inspect) plus the exact resource being inspected: a PR/MR along with its Sonar quality gate, coverage, duplication, issues, and hotspots. It also explicitly separates itself from review_work, which handles the diff, so an agent can pick the right tool 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 Guidelines5/5

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

It gives explicit routing ('Use review_work read for the diff') and conditional parameter guidance ('Supply ruleKey for remediation details or filePath (and lines) for source context'). It also states the follow-up condition that a fresh Sonar analysis is required to confirm a fix, so when-to-use and what-happens-next are both covered.

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