Skip to main content
Glama

sonar_project_metrics

Read-only

Retrieve SonarQube or SonarCloud project metrics for a given project key: quality gate status, three ratings, bugs, vulnerabilities, code smells, coverage, and duplication.

Instructions

SonarQube 项目指标:质量门禁、三项评级、Bug/漏洞/异味数、覆盖率、重复率。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sonar_project_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
project_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

C2.6/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered structurally. The description adds no behavioral context at all – not what happens when project_key is omitted (it defaults to an empty string, which is undefined behavior), not the scope of the query, and not whether the call is slow or rate-limited for a remote SonarQube instance.

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?

One compact sentence with no filler, and the metric list is packed efficiently. It is front-loaded with the domain but not with an action verb, which is the one structural weakness.

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?

With no output schema, the enumeration of returned metrics usefully substitutes for a return-value description. But the description leaves the key ambiguity (project_key default empty) and the absence of usage guidance unresolved for a tool with several overlapping siblings.

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

Parameters2/5

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

The single parameter project_key has 0% schema description coverage and an empty-string default, and the description never mentions it. An agent cannot tell what identifier format is expected or what the empty default does, so the description fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource (SonarQube 项目指标) and enumerates the returned metrics (quality gate, three ratings, bugs/vulnerabilities/code smells, coverage, duplication), so the domain is clear. However it is a bare noun phrase with no verb indicating retrieval, and it does not distinguish itself from siblings such as sonar_issues, code_quality_scan, or full_quality_report, which plausibly overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no statement of when to call this tool or when to prefer an alternative. With siblings like full_quality_report and code_quality_scan present, an agent has no basis for routing between them from this description.

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