Skip to main content
Glama
jermeyyy
by jermeyyy

get_gradle_config

Retrieve current Gradle configuration including JVM arguments, daemon settings, and version information to diagnose memory issues and understand project setup.

Instructions

Get current Gradle configuration including memory settings.

Returns configuration from gradle.properties and gradle-wrapper.properties including JVM args, daemon settings, and Gradle version info. Useful for diagnosing memory issues or understanding project configuration.

Returns: GradleConfigResult with JVM args, daemon/parallel/caching settings, max workers, distribution URL, and Gradle version.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
jvm_argsYes
max_workersYes
daemon_enabledYes
gradle_versionYes
caching_enabledYes
distribution_urlYes
parallel_enabledYes

Implementation Reference

  • MCP tool handler for get_gradle_config. Creates GradleWrapper instance, calls its get_config() method, and returns structured GradleConfigResult or empty on error.
    @mcp.tool()
    async def get_gradle_config(ctx: Context | None = None) -> GradleConfigResult:
        """Get current Gradle configuration including memory settings.
    
        Returns configuration from gradle.properties and gradle-wrapper.properties
        including JVM args, daemon settings, and Gradle version info.
        Useful for diagnosing memory issues or understanding project configuration.
    
        Returns:
            GradleConfigResult with JVM args, daemon/parallel/caching settings,
            max workers, distribution URL, and Gradle version.
        """
        try:
            if ctx:
                await ctx.info("Getting Gradle configuration")
    
            gradle = _get_gradle_wrapper(ctx)
            config = gradle.get_config()
    
            if ctx:
                await ctx.info("Retrieved Gradle configuration successfully")
    
            return GradleConfigResult(
                jvm_args=config["jvm_args"],
                daemon_enabled=config["daemon_enabled"],
                parallel_enabled=config["parallel_enabled"],
                caching_enabled=config["caching_enabled"],
                max_workers=config["max_workers"],
                distribution_url=config["distribution_url"],
                gradle_version=config["gradle_version"],
            )
        except Exception as e:
            # Return a result with None values and could log the error
            if ctx:
                await ctx.error("Failed to get Gradle configuration", extra={"error": str(e)})
            # Return empty config - all fields are optional (None)
            return GradleConfigResult(
                jvm_args=None,
                daemon_enabled=None,
                parallel_enabled=None,
                caching_enabled=None,
                max_workers=None,
                distribution_url=None,
                gradle_version=None,
            )
  • Pydantic model defining the output schema for the get_gradle_config tool response.
    class GradleConfigResult(BaseModel):
        """Result of Gradle configuration query."""
    
        jvm_args: str | None
        daemon_enabled: bool | None
        parallel_enabled: bool | None
        caching_enabled: bool | None
        max_workers: int | None
        distribution_url: str | None
        gradle_version: str | None
  • Core helper method in GradleWrapper class that reads and parses gradle.properties and gradle-wrapper.properties to extract configuration values like JVM args, daemon/parallel/caching settings, max workers, distribution URL, and Gradle version.
    def get_config(self) -> dict:
        """Get current Gradle configuration including memory settings.
    
        Returns:
            dict with:
            - jvm_args: str | None (from gradle.properties org.gradle.jvmargs)
            - daemon_enabled: bool | None (from org.gradle.daemon)
            - parallel_enabled: bool | None (from org.gradle.parallel)
            - caching_enabled: bool | None (from org.gradle.caching)
            - max_workers: int | None (from org.gradle.workers.max)
            - distribution_url: str | None (from wrapper properties)
            - gradle_version: str | None (extracted from distribution URL)
        """
    
        def parse_bool(value: str | None) -> bool | None:
            """Parse a boolean string value."""
            if value is None:
                return None
            return value.lower() == "true"
    
        def parse_int(value: str | None) -> int | None:
            """Parse an integer string value."""
            if value is None:
                return None
            try:
                return int(value)
            except ValueError:
                return None
    
        def extract_gradle_version(distribution_url: str | None) -> str | None:
            """Extract Gradle version from distribution URL.
    
            Examples:
                - https://services.gradle.org/distributions/gradle-8.5-bin.zip -> 8.5
                - https://services.gradle.org/distributions/gradle-8.5-all.zip -> 8.5
            """
            if distribution_url is None:
                return None
            # Match patterns like gradle-8.5-bin.zip or gradle-8.5-all.zip
            match = re.search(r"gradle-([\d.]+(?:-\w+)?)-(?:bin|all)\.zip", distribution_url)
            if match:
                return match.group(1)
            return None
    
        gradle_props = self.gradle_properties
        wrapper_props = self.wrapper_properties
    
        distribution_url = wrapper_props.get("distributionUrl")
    
        return {
            "jvm_args": gradle_props.get("org.gradle.jvmargs"),
            "daemon_enabled": parse_bool(gradle_props.get("org.gradle.daemon")),
            "parallel_enabled": parse_bool(gradle_props.get("org.gradle.parallel")),
            "caching_enabled": parse_bool(gradle_props.get("org.gradle.caching")),
            "max_workers": parse_int(gradle_props.get("org.gradle.workers.max")),
            "distribution_url": distribution_url,
            "gradle_version": extract_gradle_version(distribution_url),
        }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool as a read-only operation that returns configuration data, which is appropriate, but lacks details on potential side effects, error handling, or performance characteristics (e.g., whether it's resource-intensive). It adds some context by mentioning the source files and use cases, but could be more comprehensive for a tool with zero annotation coverage.

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 well-structured and front-loaded, starting with the core purpose and followed by details on returns and usage. Every sentence adds value: the first defines the action, the second specifies sources and content, the third provides context, and the fourth outlines the output structure. There is no wasted text, making it highly efficient.

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?

Given the tool's complexity (read-only configuration retrieval), no annotations, 0 parameters, and the presence of an output schema (which handles return values), the description is largely complete. It covers purpose, sources, use cases, and output structure. However, it could improve by addressing potential limitations or dependencies, such as requiring Gradle to be installed or file access permissions.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on the tool's purpose and output without redundant parameter details, earning a baseline score above 3. It effectively compensates by explaining what the tool retrieves, which aligns with the lack of inputs.

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 states the specific action ('Get current Gradle configuration') and resource ('memory settings, gradle.properties, gradle-wrapper.properties'), distinguishing it from siblings like 'list_projects' or 'run_task' that perform different operations. It precisely identifies what configuration elements are retrieved, making the purpose unambiguous.

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?

The description provides clear context for when to use this tool ('Useful for diagnosing memory issues or understanding project configuration'), which helps differentiate it from siblings focused on execution or listing. However, it does not explicitly state when not to use it or name specific alternatives, such as using 'daemon_status' for daemon-specific checks instead.

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/jermeyyy/gradle-mcp'

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