Skip to main content
Glama
nielspeter

SonarLint MCP Server

by nielspeter

fix_issue

Apply SonarLint's suggested fix to a specific code quality issue at a given file, line, and rule. Modifies the file directly to resolve the issue.

Instructions

Automatically fix one specific code quality issue. Applies the SonarLint-suggested fix for the issue at the given file, line, and rule. The file is modified directly. To fix all issues in a file at once, use fix_all_issues instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYesLine number of the issue
ruleYesRule ID (e.g., 'javascript:S3504')
filePathYesAbsolute path to the file to fix
Behavior4/5

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

The description discloses that 'the file is modified directly' and that it applies a SonarLint-suggested fix. With no annotations provided, this transparency is valuable. No mention of what happens on failure, but acceptable for a simple tool.

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-loaded with purpose, followed by behavioral detail and alternative tool. No wasted words.

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?

Given the three required parameters and no output schema, the description adequately covers the action and behavior. It could mention what happens on success or failure, but the tool is straightforward.

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 description coverage is 100%, so baseline is 3. The description mentions the three parameters (file, line, rule) but adds no additional meaning beyond the schema descriptions.

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 starts with a clear verb ('fix') and resource ('one specific code quality issue'), and is explicitly distinguished from the sibling tool fix_all_issues. It states it applies SonarLint-suggested fix, providing precise scope.

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 description provides explicit guidance: use this tool for one issue, and use fix_all_issues for all issues. It does not mention when not to use (e.g., if review is needed), but the context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nielspeter/sonarlint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server