Skip to main content
Glama

SonarLint: scan folder

sonarlint_scan_folder

Scans every analyzable file in a folder with local SonarLint analysis, skips build and dependency directories, and returns issues grouped by file.

Instructions

Run a local SonarLint analysis on every analyzable file under a folder (skips node_modules, build dirs, .git, etc.). Returns issues grouped by file.

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": "sonarlint_scan_folder"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderNoFolder to scan (default: current workspace root)
maxFilesNoMaximum number of files to scan (default 400)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose meaningful behavior beyond the name, namely which directories are skipped and that results come back grouped by file. It omits whether the scan mutates anything, whether a SonarLint configuration or binding is required, and any performance or long-running behavior despite a 5000-file ceiling.

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 tight sentences with the core action front-loaded and the skip rules plus return shape packed into the remainder. No filler and nothing repeated from structured fields.

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 two-parameter, zero-required tool with full schema coverage, the description covers the action, the exclusion behavior, and the shape of the return value, which is what an agent needs to select and call it. The missing piece is disambiguation from the sibling scan tools.

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 both the folder default and the maxFiles range/default are already fully documented in the schema. The description adds no syntax or format detail beyond that, which is the expected baseline.

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

Purpose4/5

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

States a specific verb (run analysis) and resource scope (every analyzable file under a folder), and clarifies that it skips node_modules, build dirs, and .git. It does not explain how 'folder' differs from the sibling sonarlint_scan_project, so an agent must infer the boundary between the two scopes.

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 explicit when-to-use guidance and no when-not guidance relative to sonarlint_scan_file or sonarlint_scan_project. The only contextual hint is the parenthetical exclusion list, which describes scan behavior rather than tool selection.

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