> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-mcp-server/reference/tools.md).

# Tools

Reference for the SonarQube MCP Server tools, toolsets, and supported parameters.

The `SONARQUBE_TOOLSETS` environment variable accepts a comma-separated list of toolsets to enable. See the [#tool-enablement](/sonarqube-mcp-server/reference/environment-variables.md#tool-enablement) article for a list of available toolsets.

## SonarQube Cloud organization

On SonarQube Cloud, these tools accept an optional `organization` argument when the organization is not fixed:

* `analyze_code_snippet`
* `run_advanced_code_analysis`
* `search_dependency_risks`
* `search_sonar_issues_in_projects`
* `search_my_sonarqube_projects`
* `list_quality_gates`
* `show_rule`
* `create_webhook`
* `list_webhooks`
* `architecture_get`
* `architecture_set`

Pass a key from [`list_organizations`](#projects). The argument applies only to that call. `list_organizations`, and tools that take only a resource identifier, do not use `organization`.

When [`SONARQUBE_ORG`](/sonarqube-mcp-server/reference/environment-variables.md#sonarqube_org) fixes the organization, those tools omit `organization`. A call that includes it fails with `Organization is fixed by SONARQUBE_ORG. Remove the organization argument.` In stdio, the environment variable fixes the organization. For a token request in Streamable HTTP, a deprecated `SONARQUBE_ORG` set on the SonarQube MCP Server or a request `SONARQUBE_ORG` header does the same for that scope.

An OAuth request on the [SonarQube Cloud-hosted MCP server](/sonarqube-mcp-server/setup/sonarqube-cloud-hosted.md#sign-in-with-oauth) rejects a `SONARQUBE_ORG` header with `SONARQUBE_ORG is not supported for OAuth requests. Use the tool organization argument.` Pass `organization` on the tool call. The scopes `mcp:tools:read` and `mcp:tools:write` independently control read and write tools. A call outside your scopes fails with `Insufficient OAuth scope`.

If the organization is missing, the tool fails with `Organization is required. Call list_organizations first, then pass its key as organization, or configure SONARQUBE_ORG.` `analyze_code_snippet` and `run_advanced_code_analysis` return that guidance before they wait for analyzers or read files. Profile and rule lookups for `analyze_code_snippet` use the organization selected for that call.

In stdio, a token that belongs to one organization uses that organization as the default. Zero or multiple organizations leave it unresolved. A tool argument does not change that default.

Vortex context tools use the organization configured at startup, or the single organization detected at startup. A later `organization` argument does not retarget that proxied engine. When startup leaves the organization unresolved, the server does not start the Vortex context proxy.

`run_advanced_code_analysis` is separate from that proxy. On SonarQube Cloud stdio, the server registers it when the workspace is mounted and at least one organization you can access has an active Vortex subscription, even when startup leaves the organization unresolved. [`SONARQUBE_ORG`](/sonarqube-mcp-server/reference/environment-variables.md#sonarqube_org) limits that check to the fixed organization. Each call checks the organization you select. An organization without Vortex fails with `Vortex is not enabled for the selected SonarQube Cloud organization.`

## SonarQube Cloud-hosted MCP server

The embedded MCP server includes a default list of toolsets. Define a subset of this list using the `SONARQUBE_TOOLSETS` header:

* `analysis`,`coverage`,`dependency-risks`,`duplications`,`quality-gates`,`issues`,`measures`,`projects`,`rules`,`security-hotspots`
* Sonar Vortex analysis is not available on the SonarQube Cloud-hosted MCP server because it requires a local filesystem mount. To use [Sonar Vortex analysis](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-analysis.md), set up a local MCP Server using [Stdio](/sonarqube-mcp-server/setup/self-hosted.md#local-server-stdio).
* For details about the tools in each toolset, see the relevant section below.

## Agentic Readiness

Agentic Readiness tools are available only on SonarQube Cloud when the feature is enabled for your organization. In stdio mode, the server checks the feature flag at startup. In HTTP or HTTPS mode, the server does not load these tools unless you opt in explicitly. To opt in, set `SONARQUBE_TOOLSETS` on the server and include `agentic-readiness` along with every other toolset you need, because setting the variable replaces the defaults. This applies even though `agentic-readiness` is in the default toolset list.

## Branch and pull request context

Many tools accept optional `branch` or `pullRequest` parameters to analyze a specific branch or pull request.

**SonarQube Cloud** has three analysis contexts:

* **Long-lived branches** (main, develop, release/\*): use `branch`. Discover valid names with `list_branches` (`branchTypes=LONG` or check the `type` field).
* **Short-lived branches** (feature branches analyzed without pull requests): use `branch`. Discover via `list_branches` (`branchTypes=SHORT` or check the `type` field), or pass the current git branch name directly.
* **Pull requests**: use `pullRequest`. Discover keys with `list_pull_requests`.

**SonarQube Server** has two analysis contexts:

* **Branches**: use `branch`. Discover names with `list_branches`, or pass the current git branch name directly.
* **Pull requests**: use `pullRequest`. Discover keys with `list_pull_requests`.

For both environments:

* Don't pass a git branch name to `pullRequest` — it expects the SonarQube pull request key.
* Don't provide both `branch` and `pullRequest` on the same call.
* Omit both to query the default (main) branch analysis.

## 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><strong>Deprecated:</strong> <code>analyze\_code\_snippet</code> will be removed in a future release. Connect SonarQube for IDE to use <code>analyze\_file\_list</code>, or enable Vortex analysis for your organization to use <code>run\_advanced\_code\_analysis</code> (see below).<br><br>Supported Languages: Java, Kotlin, Python, Ruby, Go, JavaScript (<code>js</code>, <code>jsx</code>), TypeScript (<code>ts</code>, <code>tsx</code>), 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, <code>java</code>, <code>python</code>, <code>js</code>, <code>ts</code>, <code>tsx</code>, <code>jsx</code>.</li><li><code>projectKey</code> (string, optional): Optional SonarQube project key. Defaults to the configured project when <code>SONARQUBE\_PROJECT\_KEY</code> is set; otherwise uses organization default quality profiles when omitted. Use <code>search\_my\_sonarqube\_projects</code> when the key is unknown.</li><li><code>scope</code> (string, optional): Scope of the file: MAIN or TEST. Default: MAIN.</li><li><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</li></ul><p>Response fields:</p><ul><li><code>deprecationNotice</code> (string): Deprecation notice for this tool.</li></ul><p>NOTE: The <strong>analyze\_code\_snippet</strong> tool is disabled if you are using the MCP server embedded in SonarQube Cloud. A self-hosted server connected to SonarQube Cloud over HTTP or HTTPS also does not register analysis tools. For a full overview of which tools are unavailable with the embedded server and why, see <a href="/sonarqube-mcp-server/setup/sonarqube-cloud-hosted.md#tool-availability-with-sonarqube-cloud">Tool availability with SonarQube Cloud</a>.</p> |

### When integration with SonarQube for IDE is enabled

These two tools are tagged under both the `analysis` and `ide` toolsets.

| 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 automatically analyzes files as you modify them in the working directory. When disabled, automatic analysis is turned off. | `enabled` (boolean, required): Enable or disable the automatic analysis.                    |

### When Vortex analysis is available

[Vortex analysis](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-analysis.md) is available with an active subscription when you run the MCP server in stdio mode with SonarQube Cloud, or with SonarQube Server 2026.5 and newer Enterprise or Data Center edition.

The server selects one analysis path at startup. Enabled toolsets still apply.

* **SonarQube Cloud:** Vortex analysis (`run_advanced_code_analysis`) when the workspace is mounted and at least one organization has an active subscription; local analysis otherwise. A call accepts only an organization with an active subscription.
* **SonarQube Server:** Vortex analysis when the instance has an active subscription and the workspace is mounted. Local analysis when the instance does not have Vortex.

Local analysis uses SonarQube for IDE when it is connected, or `analyze_code_snippet`. Without a workspace mount, snippet analysis requires `fileContent`.

On SonarQube Cloud, `SONARQUBE_ORG` limits the subscription check to that organization. To analyze snippets for every organization, set [`SONARQUBE_FORCE_LOCAL_ANALYSIS`](/sonarqube-mcp-server/reference/environment-variables.md#sonarqube_force_local_analysis) to `true`, enable the `analysis` toolset, and restart. That setting registers `analyze_code_snippet` even when SonarQube for IDE is connected. It has no effect on SonarQube Server or on SonarQube Cloud over HTTP or HTTPS.

Over HTTP and HTTPS, SonarQube Server supports snippet analysis when a startup `SONARQUBE_TOKEN` is set. SonarQube Cloud exposes no analysis tools.

> Requires having the workspace mounted at `/app/mcp-workspace`

When the server selects Vortex analysis, it does not register `analyze_code_snippet` or the SonarQube for IDE bridge tools (`analyze_file_list`, `toggle_automatic_analysis`).

| Tool                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **run\_advanced\_code\_analysis**: Run Vortex analysis on a single file. On SonarQube Cloud, pass optional `organization` when `SONARQUBE_ORG` does not fix the organization. Call `list_organizations` when the organization is ambiguous (see [SonarQube Cloud organization](#sonarqube-cloud-organization)). The call checks that organization's subscription and fails with `Vortex is not enabled for the selected SonarQube Cloud organization.` when Vortex is not enabled. SonarQube Server uses the nil UUID placeholder. 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 scan for higher-precision results. | <p><code>organization</code> (string, optional): Organization key. Use only when <code>SONARQUBE\_ORG</code> is unset; call <code>list\_organizations</code> if ambiguous. Defaults to the configured organization, or to the single organization detected at startup.</p><p><code>projectKey</code> (key, required): The key of your project. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>branch</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> |

## Vortex context

The following tools are available with an active Sonar Vortex subscription. For more information, see [Sonar Vortex context](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-context.md).

### Semantic navigation

| 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>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Architecture

| Tool                                                                                                                                                                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **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

> **Note:** Third-party dependency tools are only available when [SCA](/sonarqube-cloud/advanced-security/analyzing-projects-for-dependencies-sca.md) is enabled for your SonarQube Cloud organization.

| 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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</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

> **Note:** Dependency risks require SonarQube Advanced Security. On SonarQube Cloud, enable [Advanced Security](/sonarqube-cloud/advanced-security/analyzing-projects-for-dependencies-sca.md) for the organization. On SonarQube Server, use version 2025.4 Enterprise edition or higher with [SonarQube Advanced Security](/sonarqube-server/2025.4/advanced-security.md) enabled.

| 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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</p><p><code>pageIndex</code> (integer, optional): Page index. Default: 1.</p><p><code>pageSize</code> (integer, optional): Page size. Must be greater than 0 and less than or equal to 500. Default: 100.</p><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</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): File key.</p><p><code>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</p>                                                                                                                                                                                                                                                                                                                                                                                                                    |

## Enterprises

> **Note:** Enterprise tools are only available when connecting to SonarQube Cloud Enterprise.

| 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><p><code>comment</code> (string, optional): Optional comment explaining the status change.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **search\_sonar\_issues\_in\_projects**: Search for SonarQube issues in your 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>tags</code> (array of strings, optional): List of issue tags to filter by. Tags are lowercase.</p><p><code>inNewCodePeriod</code> (boolean, optional): Only return issues in the new code period. Requires exactly one entry across <code>projectKeys</code> and <code>files</code>.</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.</p><p><code>pageIndex</code> (integer, optional): 1-based page index. Default: 1.</p><p><code>projectKeys</code> (array of strings, optional): Optional list of SonarQube project keys.</p><p><code>pageSize</code> (integer, optional): Page size. Must be greater than 0 and less than or equal to 500. Default: 100.</p><p><code>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</p><p><code>severities</code> (array of strings, optional): List of severities to filter by. Possible values: INFO, LOW, MEDIUM, HIGH, BLOCKER.</p><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</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>projectKey</code> (string, required): The project key. Required when <code>SONARQUBE\_PROJECT\_KEY</code> is not configured.</p><p><code>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>metricKeys</code> (array of strings, optional): Metric keys to retrieve (for example: ncloc, complexity, violations, coverage, new\_violations).</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</p><p>New Code metrics (typically <code>new\_\*</code>) return their New Code period value in <code>value</code>.</p><p>Response fields:</p><ul><li><code>value</code> (string): Measure value. For New Code metrics, this is the New Code period value.</li><li><code>period</code> (integer, optional): New Code period index. Present when the value is a New Code metric.</li><li><code>bestValue</code> (boolean, optional): Whether this is the metric's best possible value.</li></ul> |

## Metrics

| Tool                                               | Type                                                                                                                                                                                                               |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **search\_metrics**: Search for SonarQube metrics. | <p><code>pageIndex</code> (integer, optional): 1-based page index. Default: 1.</p><p><code>pageSize</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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **list\_organizations**: List SonarQube Cloud organizations that you're a member of, including each organization's key, name, ID, and UUID. Use a returned key as `organization` on organization-aware tools. Available on SonarQube Cloud only. The tool does not take an `organization` argument.                                                                                                                                                                                                                                  | <p>No parameters.</p><p>Response fields:</p><ul><li><code>organizations</code> (array): Organizations you're a member of. Each item includes <code>key</code>, <code>name</code>, <code>id</code>, and <code>uuidV4</code>.</li></ul>                                                                                                                                                                                                                                                                                                                       |
| **search\_my\_sonarqube\_projects**: Find SonarQube projects. The response is paginated.                                                                                                                                                                                                                                                                                                                                                                                                                                             | <p><code>pageIndex</code> (integer, optional): 1-based page index. Default: 1.</p><p><code>pageSize</code> (integer, optional): Page size. Must be greater than 0 and less than or equal to 500. Default: 500.</p><p><code>q</code> (string, optional): Search query to filter projects by name (partial match) or key (exact match).</p><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</p> |
| **list\_branches**: List analyzed branches for a project. **SonarQube Cloud**: returns long-lived (`LONG`) and short-lived (`SHORT`) branches with `type` and `mergeBranch` fields. Optional `branchTypes` filter: `ALL` (default), `LONG`, or `SHORT`. **SonarQube Server**: returns all analyzed branches (name, quality gate, analysis date). No `type`, `mergeBranch`, or `branchTypes` filter. Use returned branch names as the `branch` parameter on other tools. For pull request analysis, use `list_pull_requests` instead. | <p><code>projectKey</code> (string, required): Project key. Ignored when <code>SONARQUBE\_PROJECT\_KEY</code> is defined.</p><p><code>branchTypes</code> (enum, optional, SonarQube Cloud only): Filter branches by type. <code>ALL</code> (default), <code>LONG</code>, or <code>SHORT</code>.</p>                                                                                                                                                                                                                                                         |
| **list\_pull\_requests**: List all pull requests for a project. Use this tool to discover pull requests for PR-decorated analysis (coverage, issues, quality gate). Returns the pull request key/ID which can be used with other tools. For branch-based analysis without pull requests, use `list_branches` instead.                                                                                                                                                                                                                | `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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</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): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</p> |
| **list\_quality\_gates**: List all quality gates in my SonarQube.                               | `organization` (string, optional): SonarQube Cloud organization key. Use only when `SONARQUBE_ORG` is unset. Call `list_organizations` if the organization is ambiguous.                                                                                                                                                                                                                                                                                                                          |

## Rules

| Tool                                                               | Type                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **show\_rule**: Shows detailed information about a SonarQube rule. | <p><code>key</code> (string, required): Rule key.</p><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</p> |

## 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>branch</code> (string, optional): Optional branch name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</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 name for branch-based analysis. Use <code>list\_branches</code> to discover valid names.</p><p><code>pullRequest</code> (string, optional): Optional pull request key/ID. Use <code>list\_pull\_requests</code> to discover valid keys.</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>pageIndex</code> (integer, optional): 1-based page index. Default: 1.</p><p><code>pageSize</code> (integer, 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

> **Note:** System tools are only available when connecting to SonarQube Server.

| 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><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</p> |
| **list\_webhooks**: List all webhooks for the SonarQube organization or project. Requires *Administrator* permissions on the specified project, or *Global Administrator* permissions.     | <p><code>projectKey</code> (string, optional): Project key to list project-specific webhooks.</p><p><code>organization</code> (string, optional): SonarQube Cloud organization key. Use only when <code>SONARQUBE\_ORG</code> is unset. Call <code>list\_organizations</code> if the organization is ambiguous.</p>                                                                                                                                                                                                             |

## Architecture

> **Note:** On SonarQube Cloud, the architecture tools require a Team or Enterprise plan.

Add `architecture` to [`SONARQUBE_TOOLSETS`](/sonarqube-mcp-server/reference/environment-variables.md#available-toolsets) to enable these tools in stdio, HTTP, or HTTPS mode. The toolset is not enabled by default. SonarQube Server registers current architecture only. Intended reads and writes stay on SonarQube Cloud until a public API can resolve a project UUID from a project key.

On SonarQube Cloud, pass `organization` only when none is configured or detected. A current read fails without a resolved organization. For details, see the [SonarQube Cloud organization](#sonarqube-cloud-organization) article.

`architecture_get` reads current dependencies or intended groups and constraints.

A current view shows at most 150 nodes, 20 dependencies, and 5 feedback pairs across languages. Narrow the view with `component` or `language`. Omitted siblings can remain undiscoverable, which means a capped view is not a complete graph export. Current graph reads allow two concurrent calls for each tool instance. Further calls wait up to five seconds, then fail with `Architecture reads are busy. Try again shortly.` Each accepted call still downloads and processes the full selected graph.

* `target` (required): `current` or `intended` on SonarQube Cloud; `current` on SonarQube Server
* `projectKey` (required string): Project key, ignored when `SONARQUBE_PROJECT_KEY` is defined
* `organization` (optional string, SonarQube Cloud): Organization key when none is configured or detected; a `current` read fails without a resolved organization
* `component` (optional string): Exact key from this tool, with no wildcards (Java current keys use `module:package`; intended keys join group labels with `/`); top level when omitted
* `depth` (optional number): Levels below the start (default 1 for `current`, all levels for `intended`); must be 1 or more
* `language` (optional): `java`, `cs`, `js`, `ts`, or `py` (all languages when omitted)

`architecture_set` replaces the whole intended model on SonarQube Cloud. Start from an unfiltered `architecture_get` response with `target` set to `intended`, and set `dryRun` to `true` to review the diff before you apply it. SonarQube Server does not register this tool. It's hidden when [`SONARQUBE_READ_ONLY`](/sonarqube-mcp-server/reference/environment-variables.md#sonarqube_read_only) is `true`. An OAuth call needs both `mcp:tools:read` and `mcp:tools:write`. A call outside those scopes fails with `Insufficient OAuth scope`.

The call removes any perspective or group you omit. Keep labels, descriptions, and imported pattern links from the exported model. Imported patterns stay references: the public export does not expand their groups or constraints, and you cannot edit those imported contents. A group that imports a pattern cannot declare child groups. The call rejects partial views and an empty model. Supply the whole response to enable the revision check. A bare `models` array without `revision` cannot detect changes since the export. Concurrent edits can still race the check, and a mismatch changes nothing. The server returns a definite client rejection directly. When the saved state cannot be verified, the error includes a recovery export and the server does not roll back automatically.

A successful call returns `mode` as `dry-run`, `unchanged`, `created`, or `replaced`, plus a `diff` of removed, added, and changed entries.

* `target` (required): `intended`
* `projectKey` (required string): Project key, ignored when `SONARQUBE_PROJECT_KEY` is defined
* `organization` (optional string, SonarQube Cloud): Organization key when none is configured or detected
* `model` (required string): Whole JSON response, or its `models` array, from an unfiltered `architecture_get` with `target` `intended` (partial views are rejected)
* `dryRun` (required boolean): `true` to validate and list the changes, `false` to write them
* `revision` (optional string): Revision from `architecture_get` (defaults to the revision on the whole response); a mismatch prevents the write


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-mcp-server/reference/tools.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
