Skip to main content
Glama
igorolv

sonar-mcp-server

getProject

getProject
Read-onlyIdempotent

Retrieve a project's SonarQube analysis: quality gate failures, size, findings, coverage, duplication, technical debt. Specify branch or pull request for non-default refs.

Instructions

Get one project analysis. Returns project metadata, quality gate failures, and metrics for size, findings, coverage, duplication, and technical debt. 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoBranch name; mutually exclusive with `pullRequest`. Omission uses the configured default (usually main). For non-main work, pass explicitly; use `listProjectBranches`.
projectKeyNoProject key; omit only if the server has a default. Discover with `listProjects`.
pullRequestNoPR key; mutually exclusive with `branch`; no default. For PR work, pass explicitly; use `listProjectPullRequests`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoHuman-readable project name.
metricsNo
versionNoProject version string, if configured.
qualifierNoProject qualifier: TRK for a main project, VW for a portfolio, APP for an application.
projectKeyNoUnique project key.
visibilityNoVisibility setting: 'public' or 'private'.
descriptionNoOptional project description.
qualityGateNo
lastAnalysisDateNoISO-8601 timestamp of the most recent successful analysis.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, so the bar is lower. The description adds valuable behavioral context: the default-branch scoping rule, mutually exclusive ref parameters, and the categories of returned data. It does not contradict any annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences front-load the operational purpose before the scoping rule. Every clause contributes either return semantics or a routing instruction, with no filler or redundancy.

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?

With a rich output schema, safety annotations, and fully documented parameters, the description supplies the remaining decision-relevant context: default ref selection and how to discover refs. Nothing needed to select or invoke the tool correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and each parameter description already covers defaults, mutual exclusivity, and discovery via sibling tools. The description reinforces this guidance but adds no new parameter-level meaning, so the baseline of 3 applies.

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 ('Get'), a singular resource ('one project analysis'), and enumerates return content (project metadata, quality gate failures, and metrics for size, findings, coverage, duplication, and technical debt). This clearly distinguishes it from sibling list/issue tools without needing to inspect their 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?

Explicitly instructs when to omit both refs (configured default, usually main) and when to pass the matching ref explicitly for non-main or PR work. It names concrete discovery alternatives (`listProjectBranches` / `listProjectPullRequests`), giving an agent direct routing guidance.

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