Skip to main content
Glama
igorolv

sonar-mcp-server

listIssues

listIssues
Read-onlyIdempotent

Retrieve project issues with filters for severity, type, status, rule, path, or ref, providing rule details, severity, status, message, file location, and cross-file flows. Defaults to open issues.

Instructions

List project issues with optional severity, type, status, rule, path, and ref filters. Returns rule, severity, type, status, message, file location/text range, and cross-file flows. Defaults to open issues. 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
limitNoPage size; server default if omitted.
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`.
offsetNoOffset; default 0.
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`.
componentPathPrefixNoSonar `componentPath` prefix relative to the project root; an exact file path is also allowed. Uses directory boundaries, so `src` does not match `srcExtra`. For Java/Kotlin packages use slashes. Sonar paths may differ from repository paths; use `listComponents` instead of guessing. If `pathPrefixTruncated=true`, narrow the prefix.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsNoIssues in this page.
limitNoMaximum number of items per page.
totalNoTotal number of issues matching the query across all pages.
offsetNoZero-based offset of this page within the full result set.
branchAdvisoryNo
pathPrefixTruncatedNoTrue when componentPathPrefix was supplied and the underlying scan hit the configured maximum issue count before exhausting Sonar. The returned `total` and `items` reflect only the scanned slice; tighten the prefix to see the rest.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.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 readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered. The description adds valuable behavior beyond annotations: defaults to open issues, the configured-default branch behavior, and the branchAdvisory retry instruction. It does not discuss pagination, rate limits, or auth, but those are less critical for a read-only list tool.

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 front-loaded with the core purpose and filters, then returns, then defaults and usage guidance. It is slightly long but every sentence earns its place. The branchAdvisory sentence is cryptic and could be more explicit, which prevents a 5.

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 tool with 11 optional parameters and an output schema, the description covers the most important contextual aspects: default behavior, branch/PR scoping, and return contents. It does not mention projectKey default behavior or pagination semantics, but the schema covers those. The branchAdvisory guidance is a unique addition, though its source is unexplained.

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. The description adds meaning beyond the schema by clarifying the default status filter ('Defaults to open issues') and by explaining how to correctly set branch/pullRequest for non-main work. The branchAdvisory retry note also adds operational guidance not present in the schema, though it is somewhat under-defined.

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 and resource: 'List project issues' and enumerates the filter dimensions (severity, type, status, rule, path, ref), making it clear this is a listing tool for project issues. The mention of return fields like 'cross-file flows' further distinguishes it from sibling summary/hotspot/single-issue tools, even without naming them explicitly.

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 gives explicit guidance on branch and PR scope: omitting both uses the configured default, non-main or PR work requires an explicit ref, and it points to `listProjectBranches` and `listProjectPullRequests` for discovery. It does not explicitly say when to prefer `getIssue` or `listHotspots` over this tool, but it provides strong contextual instruction for the main ambiguity around scope.

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