# Tools

Note also the `SONARQUBE_TOOLSETS` environment variable that accepts a comma-separated list of toolsets to enable. See the [#tool-enablement](https://docs.sonarsource.com/sonarqube-mcp-server/build-and-configure/environment-variables#tool-enablement "mention") article for a list of available toolsets.

### MCP Server in SonarQube Cloud

Use the embedded SonarQube Cloud MCP server to avoid running and maintaining your own MCP infrastructure while always using the current server version. The embedded server exposes a smaller, fixed subset of tools; for the available toolsets and configuration details, check SonarQube Cloud's [SonarQube MCP Server #MCP Server in SonarQube Cloud](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/ai-capabilities/sonarqube-mcp-server#mcp-server-in-sonarqube-cloud "mention") page.

The embedded MCP server includes a default list of toolsets. A subset of of this list can be defined using the SONARQUBE\_TOOLSETS header:

* `analysis`,`coverage`,`dependency-risks`,`duplications`,`quality-gates`,`issues`,`measures`,`projects`,`rules`,`security-hotspots`
* The `analysis` toolset is only available to subscribers of the [Agentic Analysis](https://docs.sonarsource.com/sonarqube-cloud/ai-capabilities/agentic-analysis) add-on.
* For more details about the tools available in each toolset, find it in the table below.

## Analysis

| Tool                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>analyze\_code\_snippet</strong>: Analyze a file or code snippet with SonarQube analyzers to identify code quality and security issues. Specify the language of the snippet to improve analysis accuracy. Optionally filter results to a specific code snippet.<br><br>Supported Languages: Java, Kotlin, Python, Ruby, Go, JavaScript, TypeScript, JSP, PHP, XML, HTML, CSS, CloudFormation, Kubernetes, Terraform, ARM, Ansible, Docker, Secrets detection.</p> | <p>Usage:</p><ul><li><strong>With workspace mounted (recommended):</strong> pass <code>filePath</code> (project-relative): the server reads the file directly, keeping file content out of the agent context window.</li><li><strong>Without workspace mount:</strong> pass complete <code>fileContent</code> for full file analysis (reports all issues).</li><li>Add optional <code>codeSnippet</code> to filter results. Only issues within the snippet will be reported (snippet location auto-detected).</li></ul><p>Parameters:</p><ul><li><code>codeSnippet</code> (string, optional): Code snippet to filter issues (must match content in <code>fileContent</code>).</li><li><code>fileContent</code> (string, optional): Complete file content as a string; required when workspace is not mounted.</li><li><code>filePath</code> (string, optional): Project-relative path of the file to analyze (e.g., <code>src/main/java/MyClass.java</code>). Used when the workspace is mounted at <code>/app/mcp-workspace</code>.</li><li><code>language</code> (string, optional): Language of the code snippet. For example, 'java', 'python', 'javascript'.</li><li><code>projectKey</code> (string, required): The SonarQube project key. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</li><li><code>scope</code> (string, optional): Scope of the file: MAIN or TEST. Default: MAIN.</li></ul><p>NOTE: The <strong>analyze\_code\_snippet</strong> tool is disabled if you are using the MCP server embedded in SonarQube Cloud. For a full overview of which tools are unavailable with the embedded server and why, see <a data-mention href="https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/ai-capabilities/sonarqube-mcp-server#tool-availability-with-sonarqube-cloud">SonarQube MCP Server #Tool availability with SonarQube Cloud</a>.</p> |

### **When integration with SonarQube for IDE is enabled**

| Tool                                                                                                                                                                                                                                                      | Type                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| **analyze\_file\_list**: Analyze files in the current working directory using SonarQube for IDE. This tool connects to a running SonarQube for IDE instance to perform code quality analysis on a list of files.                                          | `file_absolute_paths` (array of strings, required): List of absolute file paths to analyze. |
| **toggle\_automatic\_analysis**: Enable or disable SonarQube for IDE automatic analysis. When enabled, SonarQube for IDE will automatically analyze files as they are modified in the working directory. When disabled, automatic analysis is turned off. | `enabled` (boolean, required): Enable or disable the automatic analysis.                    |

### When advanced analysis is enabled

Advanced analysis is available for [Agentic Analysis](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/analyzing-source-code/agentic-analysis "mention") with SonarQube Cloud.

| Tool                                                                                                                                                                                                                                                                                                                                                                                                    | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **run\_advanced\_code\_analysis**: Run advanced code analysis on SonarQube Cloud for a single file. Organization is inferred from the MCP configuration. Requires the workspace to be mounted at `/app/mcp-workspace`. Unlike `analyze_code_snippet` with a workspace mount, this tool uses full CI-level analysis context collected from a previous SonarQube Cloud scan for higher-precision results. | <p><code>projectKey</code> (key, required): The key of your project. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>branchName</code> (string, required): Branch name used to retrieve the latest analysis context.</p><p><code>filePath</code> (string, required): Project-relative path of the file to analyze (e.g., <code>src/main/java/MyClass.java</code>).</p><p><code>fileScope</code> (string, optional): Defines in which scope the file originates from: <code>MAIN</code> or <code>TEST</code>. Default: <code>MAIN</code>.</p> |

## Context Augmentation

The following tools are available when Context Augmentation is enabled and configured for your SonarQube Cloud organization. For more information, see [Context Augmentation](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/analyzing-source-code/context-augmentation "mention").

### Architecture

| Tool                                                                                                                                                                                                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **search\_by\_signature\_patterns:** Find code elements (classes, methods, interfaces) by their declaration signatures using regex patterns.                                                                 | <ul><li><code>include\_code\_regex\_list</code> - List of regex patterns to match against signatures - <em>Required String\[]</em></li><li><code>exclude\_code\_regex\_list</code> - List of regex patterns to exclude from results - <em>String\[]</em></li><li><code>include\_glob</code> - File filter glob pattern (e.g., <code>\*.java</code>) - <em>String</em></li><li><code>exclude\_glob</code> - File exclusion glob pattern - <em>String</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li><li><code>limit</code> - Maximum number of results to return (default: 10) - <em>Integer</em></li><li><code>regex\_lists\_operator</code> - How to combine multiple patterns: <code>OR</code> (default) or <code>AND</code> - <em>String</em></li></ul> |
| **search\_by\_body\_patterns:** Find code elements by their implementation body using regex patterns. Useful for locating where APIs or patterns are actually used.                                          | <ul><li><code>include\_code\_regex\_list</code> - List of regex patterns to match in code bodies - <em>Required String\[]</em></li><li><code>exclude\_code\_regex\_list</code> - List of regex patterns to exclude from results - <em>String\[]</em></li><li><code>include\_glob</code> - File filter glob pattern - <em>String</em></li><li><code>exclude\_glob</code> - File exclusion glob pattern - <em>String</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li><li><code>limit</code> - Maximum number of results to return (default: 10) - <em>Integer</em></li><li><code>regex\_lists\_operator</code> - How to combine multiple patterns: <code>OR</code> (default) or <code>AND</code> - <em>String</em></li></ul>                                  |
| **get\_upstream\_call\_flow:** Trace what functions call a given function. Useful for finding all callers and entry points, and understanding what breaks if a signature changes.                            | <ul><li><code>fqn</code> - Fully qualified name of the function - <em>Required String</em></li><li><code>depth</code> - Call chain depth (0=function only, 1=direct callers, etc.) - <em>Integer</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **get\_downstream\_call\_flow:** Trace what functions a given function calls. Useful for impact analysis and understanding execution flow.                                                                   | <ul><li><code>fqn</code> - Fully qualified name of the function - <em>Required String</em></li><li><code>depth</code> - Call chain depth (0=function only, 1=direct callees, etc.) - <em>Integer</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **get\_source\_code** - Get complete source code (signature and body) for a code element by its fully qualified name.                                                                                        | <ul><li><code>fqn</code> - Fully qualified name of the element - <em>Required String</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **get\_type\_hierarchy** - Get the full inheritance hierarchy for a class-like structure (class, interface, enum, record, exception, struct). Essential for understanding inheritance trees and refactoring. | <ul><li><code>fqn</code> - Fully qualified name of the class-like structure - <em>Required String</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **get\_references** - Get direct inbound and outbound code references for a class or module. Returns only direct (non-transitive) references.                                                                | <ul><li><code>fqn</code> - Fully qualified name of the class or module - <em>Required String</em></li><li><code>fields</code> - Comma-separated list of fields to include in the response - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **get\_current\_architecture** - Get a hierarchical architecture graph filtered by path prefix and depth. Useful for exploring module structure and high-level dependencies.                                 | <ul><li><code>depth</code> - Hierarchy depth (0=root only, 1=root + children, etc.) - <em>Required Integer</em></li><li><code>path\_prefix</code> - Optional path prefix to filter nodes (e.g., <code>com.example.service</code>) - <em>String</em></li><li><code>ecosystem</code> - Optional ecosystem to filter by (<code>java</code>, <code>cs</code>, <code>py</code>, <code>js</code>, <code>ts</code>) - <em>String</em></li></ul>                                                                                                                                                                                                                                                                                                                                                                                       |
| **get\_intended\_architecture** - Get user-defined architectural constraints specifying which modules are allowed to depend on others.                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

### Guidelines

| Tool                                                                                                                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **get\_guidelines** - Get coding guidelines based on SonarQube project issues, catalog categories, or a combination of both. | <ul><li><code>mode</code> - Guidelines retrieval mode: <code>project\_based</code>, <code>category\_based</code>, or <code>combined</code> - <em>Required String</em></li><li><code>categories</code> - List of category names (required for <code>category\_based</code> and <code>combined</code> modes) - <em>String\[]</em></li><li><code>languages</code> - List of target languages in SonarQube repository key format (required when <code>categories</code> is provided) - <em>String\[]</em></li><li><code>file\_paths</code> - Optional list of file paths to filter guidelines by - <em>String\[]</em></li></ul> |

### Dependencies

{% hint style="info" %}
Third-party dependency tools are only available when [SCA](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/advanced-security/analyzing-projects-for-dependencies-sca) is enabled for your SonarQube Cloud organization.
{% endhint %}

| Tool                                                                                                                                                                                                                                                                                                                                                                                                   | Type                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **check\_dependency** - Check a third-party dependency for security vulnerabilities, supply-chain malware, and license compliance before adding or updating it. Covers npm, Maven, PyPI, Go, NuGet, Cargo, Composer (PHP), RubyGems, and more. Must be called before modifying any dependency manifest or lockfile (e.g. `package.json`, `pom.xml`, `build.gradle`, `requirements.txt`, `Cargo.toml`). | <ul><li><code>purl</code> (string, required): Package URL (purl) with version, per <a href="https://github.com/package-url/purl-spec">purl-spec</a>. Format: <code>pkg:\<type>/\<namespace>/\<name>@\<version></code> (e.g. <code>pkg:npm/lodash\@4.17.21</code>, <code>pkg:maven/org.apache.logging.log4j/log4j-core\@2.14.1</code>, <code>pkg:pypi/django\@3.2.0</code>).</li></ul> |

## Coverage

| Tool                                                                                                                                                                                                                                                                                                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search\_files\_by\_coverage**: Search for files in a project sorted by coverage (ascending, worst coverage first). Use this tool to identify files that are candidates for test coverage improvements.                                                                                                     | <p><code>projectKey</code> (string, required): The project key to search in. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>pullRequest</code> (string, optional): Pull request id to analyze.</p><p><code>maxCoverage</code> (number, optional): Maximum coverage threshold (0–100). Only returns files with coverage less than or equal to this value.</p><p><code>pageIndex</code> (number, optional): Page index (1-based). Default: 1.</p><p><code>pageSize</code> (number, optional): Page size. Default: 100. Max: 500.</p> |
| **get\_file\_coverage\_details**: Get line-by-line coverage information for a specific file, including which exact lines are uncovered and which have partially covered branches. Use this tool after identifying low-coverage files with `search_files_by_coverage` to pinpoint where to add test coverage. | <p><code>key</code> (string, required): File key (e.g., <code>my\_project:src/foo/Bar.java</code>).</p><p><code>pullRequest</code> (string, optional): Pull request id.</p><p><code>from</code> (number, optional): First line to return (1-based). Default: 1.</p><p><code>to</code> (number, optional): Last line to return (inclusive). If not specified, all lines are returned.</p>                                                                                                                                                                      |

## Dependency risks

{% hint style="info" %}
Dependency risks are only available when connecting to SonarQube Server 2025.4 Enterprise edition or higher with [SonarQube Advanced Security](https://app.gitbook.com/s/yDv2XwTC1xoOKBYeCK45/advanced-security) enabled.
{% endhint %}

| Tool                                                                                                                                                                                                           | Type                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search\_dependency\_risks**: Search for software composition analysis issues (dependency risks) of a SonarQube project, paired with releases that appear in the analyzed project, application, or portfolio. | <p><code>projectKey</code> (string): Project key. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>branchKey</code> (string): Branch key.</p><p><code>pullRequestKey</code> (string, optional): Pull request key.</p> |

## Duplications

| Tool                                                                                                                                                                                                                                   | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search\_duplicated\_files**: Search for files with code duplications in a SonarQube project. By default, automatically fetches all duplicated files across all pages (up to 10,000 files max). Returns only files with duplications. | <p><code>projectKey</code> (string, required): Project key. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>pullRequest</code> (string, optional): Optional pull request id.</p><p><code>pageSize</code> (integer, optional): Optional number of results per page for manual pagination. Max: 500. If not specified, auto-fetches all duplicated files.</p><p><code>pageIndex</code> (integer, optional): Optional page number for manual pagination. Starts at 1. If not specified, auto-fetches all duplicated files.</p> |
| **get\_duplications**: Get duplications for a file. Require Browse permission on file's project.                                                                                                                                       | <p><code>key</code> (string, required):</p><p><code>pullRequest</code> (string, optional): Optional pull request id.</p>                                                                                                                                                                                                                                                                                                                                                                                                                              |

## Enterprises

{% hint style="info" %}
Enterprise tools are only available when connecting to a SonarQube Cloud Enterprise edition.
{% endhint %}

| Tool                                                                                                                                                                          | Type                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| **list\_enterprises**: List the enterprises available in SonarQube Cloud that you have access to. Use this tool to discover enterprise IDs that can be used with other tools. | `enterpriseKey` (string, optional): Enterprise key to filter results. |

## Issues

| Tool                                                                                                                           | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **change\_sonar\_issue\_status**: Change the status of a SonarQube issue to "accept", "falsepositive" or to "reopen" an issue. | <p><code>key</code> (string, required): Issue key</p><p><code>status</code> (enum, required): New issue's status. <em>Required Enum {"accept", "falsepositive", "reopen"}</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **search\_sonar\_issues\_in\_projects**: Search for SonarQube issues in my organization's projects.                            | <p><code>issueStatuses</code> (array of strings, optional): List of issue statuses to filter by. Possible values: OPEN, CONFIRMED, FALSE\_POSITIVE, ACCEPTED, FIXED, IN\_SANDBOX.</p><p><code>issueKey</code> (string, optional): Issue key used to fetch a specific issue.</p><p><code>impactSoftwareQualities</code> (array of strings, optional): List of software qualities to filter by. Possible values: MAINTAINABILITY, RELIABILITY, SECURITY.<br><code>p</code> (integer, optional): Page number. Default: 1.</p><p><code>projects</code> (array of strings, optional): Optional list of Sonar projects.<br><code>ps</code> (integer, optional): Page size. Must be greater than 0 and less than or equal to 500. Default: 100.</p><p><code>pullRequestId</code> (string, optional): Pull Request's identifier.<br><code>severities</code> (array of strings, optional): List of severities to filter by. Possible values: INFO, LOW, MEDIUM, HIGH, BLOCKER.</p> |

## Languages

| Tool                                                                                      | Type                                               |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------- |
| **list\_languages**: List all programming languages supported in this SonarQube instance. | `q`: Pattern to match language keys/names against. |

## Measures

| Tool                                                                                             | Type                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **get\_component\_measures**: Get SonarQube measures for a component (project, directory, file). | <p><code>component</code> (string, optional): Component key to get measures.</p><p><code>metricKeys</code> (array of strings, optional): Metric keys to retrieve (for example: ncloc, complexity, violations, coverage).</p><p><code>pullRequest</code> (string, optional): Optional pull request identifier to analyze for measures - <em>String</em></p> |

## Metrics

| Tool                                               | Type                                                                                                                                                                                          |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search\_metrics**: Search for SonarQube metrics. | <p><code>p</code> (integer, optional): Page number. Default: 1.</p><p><code>ps</code> (integer, optional): Page size. Must be greater than 0 and less than or equal to 500. Default: 100.</p> |

## Portfolios

| Tool                                                                                                           | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **list\_portfolios**: List enterprise portfolios available in SonarQube with filtering and pagination options. | <p><strong>For SonarQube Server:</strong></p><p><code>q</code> (string, optional): Search query to filter portfolios by name or key.</p><p><code>favorite</code> (boolean): If true, returns favorite portfolios.</p><p><code>pageIndex</code> (integer, optional): Optional 1-based page number. Default: 1.</p><p><code>pageSize</code> (integer, optional): Optional page size, max 500. Default: 100.</p><p><strong>For SonarQube Cloud:</strong></p><p><code>enterpriseId</code> (string): Enterprise uuid. Can be omitted only if the <code>favorite</code> parameter is supplied with value true.</p><p><code>q</code> (string, optional): Search query to filter portfolios by name.</p><p><code>favorite</code> (boolean, required): Required to be true if the <code>enterpriseId</code> parameter is omitted. If true, returns portfolios favorited by the logged-in user. Cannot be true when <code>draft</code> is true.</p><p><code>draft</code> (boolean): If true, returns drafts created by the logged-in user. Cannot be true when <code>favorite</code> is true.</p><p><code>pageIndex</code> (integer, optional): Index of the page to fetch. Default: 1,</p><p><code>pageSize</code> (integer, optional): Size of the page to fetch. Default: 50.</p> |

## Projects

| Tool                                                                                                                                                                                                                                                                                                                | Type                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| **search\_my\_sonarqube\_projects**: Find SonarQube projects. The response is paginated.                                                                                                                                                                                                                            | `page` (string, optional): Optional page number.                                               |
| **list\_pull\_requests**: List all pull requests for a project. Use this tool to discover available pull requests before analyzing their coverage, issues, or quality. Returns the pull request key/ID which can be used with other tools (For example: search\_files\_by\_coverage, get\_file\_coverage\_details). | `projectKey` (string, required): Project key. Ignored when `SONARQUBE_PROJECT_KEY` is defined. |

## Quality gates

| Tool                                                                                            | Type                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **get\_project\_quality\_gate\_status**: Get the quality gate status for the SonarQube project. | <p><code>analysisId</code> (string, optional): Analysis ID.</p><p><code>projectId</code> (string, optional): Project ID.</p><p><code>projectKey</code> (string, optional): Project key.</p><p><code>pullRequest</code> (string, optional): Pull request ID.</p> |
| **list\_quality\_gates**: List all quality gates in my SonarQube.                               |                                                                                                                                                                                                                                                                 |

## Rules

| Tool                                                               | Type                                |
| ------------------------------------------------------------------ | ----------------------------------- |
| **show\_rule**: Shows detailed information about a SonarQube rule. | `key` (string, required): Rule key. |

## Sources

| Tool                                                                                                                                | Type                                                                                                                                                                                                                                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **get\_raw\_source**: Get source code as raw text from SonarQube. Requires the *See Source Code* permission on file.                | <p><code>key</code> (string, required): File key.</p><p><code>pullRequest</code> (string, optional): Pull request id.</p>                                                                                                                                                                                               |
| **get\_scm\_info**: Get SCM information of SonarQube source files. Requires the *See Source Code* permission on the file's project. | <p><code>key</code> (string, required): File key.</p><p><code>commits\_by\_line</code> (string): If the value is false, group lines by SCM commit; else display commits for each line.</p><p><code>from</code> (number): First line to return. Starts at 1.</p><p><code>to</code> (inclusive): Last line to return.</p> |

## Security Hotspots

| Tool                                                                                                                                                                              | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search\_security\_hotspots** - Search for Security Hotspots in a SonarQube project.                                                                                             | <p><code>projectKey</code> (string): Project or application key. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>hotspotKeys</code> (array of strings): Comma-separated list of specific Security Hotspot keys to retrieve.</p><p><code>branch</code> (string, optional):- Optional branch key.</p><p><code>pullRequest</code> (string, optional): Optional pull request key.</p><p><code>files</code> (array of strings, optional): List of file paths to filter.</p><p><code>status</code> (string, optional): Optional status filter: TO\_REVIEW, REVIEWED.</p><p><code>resolution</code> (string, optional): Optional resolution filter: FIXED, SAFE, ACKNOWLEDGED.</p><p><code>sinceLeakPeriod</code> (boolean): Filter hotspots created since the leak period (new code).</p><p><code>onlyMine</code> (boolean): Show only hotspots assigned to me.</p><p><code>p</code> (integer, optional): - Optional page number. Default: 1.</p><p><code>ps</code> (integer, optional): Optional page size. Must be greater than 0 and less than or equal to 500. Default: 100.</p> |
| **show\_security\_hotspot** - Get detailed information about a specific Security Hotspot, including rule details, code context, flows, and comments.                              | `hotspotKey` - Security Hotspot key - *Required String*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **change\_security\_hotspot\_status** - Review a Security Hotspot by changing its status. When marking as REVIEWED, you must specify a resolution (FIXED, SAFE, or ACKNOWLEDGED). | <p><code>hotspotKey</code> (string, required): Security Hotspot key.</p><p><code>status</code> (enum, required): New status. <em>Required Enum {"TO\_REVIEW", "REVIEWED"}.</em></p><p><code>resolution</code> (enum): Resolution when status is REVIEWED. <em>Enum {"FIXED", "SAFE", "ACKNOWLEDGED"}</em>.</p><p><code>comment</code> (string, optional): Optional review comment.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

## System

{% hint style="info" %}
System tools are only available when connecting to SonarQube Server.
{% endhint %}

| Tool                                                                                                                                                                                        | Type                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **get\_system\_health**: Get the health status of SonarQube Server instance. Returns GREEN (fully operational), YELLOW (usable but needs attention), or RED (not operational).              |                                                                                                                           |
| **get\_system\_info**: Get detailed information about SonarQube Server system configuration including JVM state, database, search indexes, and settings. Requires 'Administer' permissions. |                                                                                                                           |
| **get\_system\_logs**: Get SonarQube Server system logs in plain-text format. Requires system administration permission.                                                                    | `name` (string, optional): Name of the logs to get. Possible values: access, app, ce, deprecation, es, web. Default: app. |
| **ping\_system**: Ping the SonarQube Server system to check if it's alive. Returns 'pong' as plain text.                                                                                    |                                                                                                                           |
| **get\_system\_status**: Get state information about SonarQube Server. Returns status (STARTING, UP, DOWN, RESTARTING, DB\_MIGRATION\_NEEDED, DB\_MIGRATION\_RUNNING), version, and id.     |                                                                                                                           |

## Webhooks

| Tool                                                                                                                                                                                       | Type                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **create\_webhook**: Create a new webhook for the SonarQube organization or project. Requires *Administrator* permissions on the specified project, or *Global Administrator* permissions. | <p><code>name</code> (string, required): Webhook name.</p><p><code>url</code> (string, required): Webhook URL.</p><p><code>projectKey</code> (string, optional): Project key for project-specific webhook.</p><p><code>secret</code> (string, optional): Webhook secret for securing the webhook payload.</p> |
| **list\_webhooks**: List all webhooks for the SonarQube organization or project. Requires *Administrator* permissions on the specified project, or *Global Administrator* permissions.     | `projectKey` (string, optional): Project key to list project-specific webhooks.                                                                                                                                                                                                                               |

<br>
