Skip to main content
Glama
lukleh
by lukleh

component_tree

Traverse project directories, files, and modules to explore SonarCloud structure. Filter by qualifiers, search names, and use branch or PR context to find specific components.

Instructions

Traverse modules/files inside a project; supports paging, qualifier filters, and branch/PR context.

Returns a hierarchical view of project components (directories, files, modules). Use this to explore project structure or find specific files.

Example: component_tree(component="my-project", qualifiers=["FIL"], q="test", branch="main")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pNoPage number (1-indexed)
qNoSearch query to filter component names (case-insensitive)
psNoPage size (max 500)
ascNoSort ascending (true) or descending (false). Defaults to true
branchNoBranch name (e.g., 'main')
strategyNoTree traversal strategy. Valid values: 'all' (default), 'children' (direct children only), 'leaves' (files only)
componentYesProject key to traverse (e.g., 'my-project')
qualifiersNoFilter by component qualifiers. Valid values: 'BRC' (branch), 'DIR' (directory), 'FIL' (file), 'TRK' (project), 'UTS' (test file). Example: ['FIL', 'DIR']
pullRequestNoPull request ID (e.g., '123')
sort_fieldsNoFields to sort by. Valid values: 'name', 'path', 'qualifier'. Example: ['name', 'path']

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the burden of indicating that this is a read-only traversal operation ('Traverse', 'Returns a hierarchical view'). It also mentions supported features like paging and filters, which goes beyond a bare statement. No side effects or auth requirements are discussed, but for a read-only tool this is sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is composed of two concise sentences plus a compact example. The first sentence front-loads the core function and supported features. Every sentence earns its place: the second clarifies output, the third gives usage guidance, and the example is illustrative without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 10 parameters, but the required one is simple and the output schema exists. The description provides enough context for the primary use case, and all parameters are richly documented in the schema. It covers the key features (paging, qualifiers, branch/PR) without needing to restate every parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. However, the description adds value by summarizing the parameter categories (paging, qualifier filters, branch/PR context) and provides a concrete example (`component_tree(component="my-project", qualifiers=["FIL"], q="test", branch="main")`) that demonstrates how parameters combine, raising the score to 4.

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

Purpose5/5

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

The description clearly identifies the tool as traversing the hierarchical component tree of a project, using a specific verb ('Traverse') and resource ('modules/files inside a project'). It distinguishes itself from sibling tools focused on issues, quality gates, and hotspots by emphasizing structural exploration.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use the tool: 'Use this to explore project structure or find specific files.' While it doesn't name alternative tools, the intended use case is unambiguous given the sibling set, making exclusions unnecessary.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

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

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lukleh/mcp-sonarcloud'

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