Skip to main content
Glama
igorolv

sonar-mcp-server

getProjectIssuesBreakdown

getProjectIssuesBreakdown
Read-onlyIdempotent

Retrieve a project's issue counts grouped by module and rule, with severity and type summaries for multi-module projects. Specify a branch or pull request; defaults to main when omitted.

Instructions

Count project issues by logical module and rule; intended for multi-module projects. A module is the first componentPath segment. Returns totals, module/rule facets, and per-module severity/type summaries. Scope explicitly: omitting both branch and pullRequest uses the configured default (usually main). For non-main or PR work, pass the matching ref explicitly; discover it with listProjectBranches / listProjectPullRequests. If branchAdvisory is present, choose the branch matching the user's ref and retry explicitly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rulesNoComma-separated rule keys, e.g. `java:S1234`.
typesNoComma-separated: CODE_SMELL,BUG,VULNERABILITY.
branchNoBranch name; mutually exclusive with `pullRequest`. Omission uses the configured default (usually main). For non-main work, pass explicitly; use `listProjectBranches`.
resolvedNoResolved filter; defaults to false only when statuses is also omitted.
statusesNoComma-separated: OPEN,CONFIRMED,REOPENED,RESOLVED,CLOSED. With no statuses/resolved, returns open issues.
projectKeyNoProject key; omit only if the server has a default. Discover with `listProjects`.
severitiesNoComma-separated: INFO,MINOR,MAJOR,CRITICAL,BLOCKER.
pullRequestNoPR key; mutually exclusive with `branch`; no default. For PR work, pass explicitly; use `listProjectPullRequests`.
componentPathPrefixNoSame Sonar `componentPath` prefix semantics as `listIssues`; use `listComponents` instead of guessing.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalNoTotal number of issues matching the query.
byRuleNoIssues grouped by rule key across the selected scope.
modulesNoPer-module issue summaries, including rule/severity/type breakdowns.
byModuleNoIssues grouped by logical module.
projectKeyNoKey of the project being analysed.
branchAdvisoryNo
pathPrefixTruncatedNoTrue when componentPathPrefix was supplied and the underlying scan hit the configured maximum issue count before exhausting Sonar. Totals/modules reflect only the scanned slice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context beyond annotations: the default-branch behavior, the mutual exclusivity of branch and pullRequest, the branchAdvisory retry instruction, and the module definition ('first componentPath segment'). It does not describe pagination or response size, but the output schema exists and the added context is substantial.

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?

The description is dense but well-organized: it front-loads the core purpose and return shape, then covers scoping behavior, then discovery/retry guidance. Every sentence earns its place, though the density of the branch/pullRequest guidance could be slightly streamlined. It is appropriately sized for a 9-parameter tool with complex scoping semantics.

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?

For a complex read-only aggregation tool with 9 optional parameters, an output schema, and rich annotations, the description covers the key decision points: when to use it, how module grouping works, how branch/PR scoping behaves, and how to discover the right refs. The only minor gap is pagination/response-size expectations, but the output schema and the tool's aggregation nature make that less critical. The description is complete enough for an agent to select and invoke it correctly.

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 100%, so the schema already documents all 9 parameters. The description adds meaning by explaining the module concept ('first componentPath segment'), clarifying the default-branch behavior, and explicitly naming discovery tools for branch, pullRequest, and componentPathPrefix. It doesn't add syntax details for every parameter, but it compensates well for the most ambiguous ones.

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 ('Count'), a resource ('project issues'), and a clear dimension ('by logical module and rule'), and explicitly distinguishes it from the sibling getProjectIssuesSummary by noting it is 'intended for multi-module projects' and returns module/rule facets. This makes the tool's purpose unambiguous and differentiates it from similar tools.

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?

The description gives explicit when-to-use guidance: it is for multi-module projects, and it explains when to pass branch/pullRequest explicitly versus relying on the default. It also names sibling tools (listProjectBranches, listProjectPullRequests, listComponents) as discovery alternatives, and even instructs retrying with branchAdvisory. This is exemplary usage guidance.

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