Skip to main content
Glama
igorolv

sonar-mcp-server

listProjectBranches

listProjectBranches
Read-onlyIdempotent

List analyzed project branches for a given project key, returning branch details like analysis date, quality gate, and issue counts to select a branch for further analysis.

Instructions

List analysed project branches. Returns name, main/type flags, analysis date, quality gate, and issue counts; use the name as branch in other tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyNoProject key; omit only if the server has a default. Discover with `listProjects`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchesNoList of branches with analysis status and issue counts.
projectKeyNoKey of the project these branches belong to.

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 behavior. The description adds value by disclosing the specific returned fields and the 'analysed project branches' selection scope, which are not visible in annotations. No contradiction with annotations.

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?

The description is a single efficient sentence that leads with the core action, then packs the essential return information and the branch-name usage note. Every clause earns its place with no filler.

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 one-parameter, read-only listing tool with a rich output schema and clear annotations, the description covers the main behavioral contract: what is listed, what is returned, and how to use the result. There are no critical missing details for correct invocation.

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%, so the schema already documents the single optional projectKey parameter. The description does not add parameter-level detail, but it does not need to since the input schema fully covers semantics including the default-server caveat and the listProjects discovery hint.

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 action and resource: 'List analysed project branches' and enumerates what is returned (name, flags, analysis date, quality gate, issue counts). This is more specific than simply restating the tool name and helps distinguish it from sibling tools like listProjects or listProjectPullRequests.

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?

The sentence 'use the name as `branch` in other tools' gives concrete downstream usage context, showing the agent when this tool is useful. It does not explicitly name alternatives or exclusion conditions, but for a straightforward listing tool this is clear enough.

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