listComponents
listComponentsSearch or browse a project's analysed component tree to get keys, paths, names, qualifiers, and languages. Use qualifiers=DIR for directory discovery; scope with branch or pull request.
Instructions
Browse or search a project's analysed component tree. Use returned path values as componentPathPrefix; Sonar paths may differ from repository paths. Returns component key, path, name, qualifier, and language. Use qualifiers=DIR to discover directories. Scope explicitly: omitting both branch and pullRequest uses the configured default (usually main). For non-main or PR work, pass the matching ref explicitly; discover it with listProjectBranches / listProjectPullRequests.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Page size; server default if omitted. | |
| query | No | Component name/path substring | |
| branch | No | Branch name; mutually exclusive with `pullRequest`. Omission uses the configured default (usually main). For non-main work, pass explicitly; use `listProjectBranches`. | |
| offset | No | Offset; default 0. | |
| projectKey | No | Project key; omit only if the server has a default. Discover with `listProjects`. | |
| qualifiers | No | Comma-separated component types, e.g. `DIR,FIL`; use `DIR` for path discovery. | |
| pullRequest | No | PR key; mutually exclusive with `branch`; no default. For PR work, pass explicitly; use `listProjectPullRequests`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Components returned by SonarQube. | |
| limit | No | Effective page size. | |
| total | No | Total matching component count reported by SonarQube. | |
| offset | No | Requested offset. |