Skip to main content
Glama
diffblue

Diffblue Cover MCP Server

Official
by diffblue

refactor

Apply automated code changes to Java projects to fix build issues and add missing dependencies via Diffblue Cover, with optional dry-run preflight.

Instructions

Invoke Diffblue Cover to refactor the project (aliased as 'fix-build').

This tool executes the dcover refactor command to apply automated refactorings, such as fixing build issues or adding missing dependencies.

Args: path: Path to the dcover executable. If not provided, searches system PATH and the DIFFBLUE_COVER_CLI environment variable. working_directory: Root directory of the Java project to test. Defaults to the current working directory. dcover_timeout: Maximum execution time in seconds. Defaults to 600. Set to None for no timeout (not recommended). dry_run: If True, passes the '--dry-run' flag to check for readiness without applying changes. args: Additional arguments to pass to dcover. Defaults to None. ctx: MCP server context for logging and progress reporting (auto-injected by FastMCP).

Returns: dict: Execution result containing: - return_code (int): Exit code (0 for success) - status (str): "success" if completed without errors - output (str): Complete stdout/stderr from dcover - command (list[str]): The exact command that was executed - working_directory (Path): Directory where command was run

Raises: ToolError: If dcover executable not found, command fails, or timeout exceeded. The error includes the partial output collected before failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoThe additional options to pass to dcover refactor
pathNoThe path to the dcover executable
dry_runNoRun preflight checks only (aliased as --preflight)
dcover_timeoutNoThe maximum time in seconds to wait for dcover to create tests.
working_directoryNoThe directory containing the project/app

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and does well: it explains that the command applies changes, that `dry_run` checks readiness without applying changes, that timeouts default to 600 seconds and can be disabled, and that failures raise `ToolError` with partial output. It does not explicitly mention file-system side effects, but 'apply automated refactorings' implies mutation clearly enough.

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

Conciseness4/5

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

The description is well-structured with clear sections for overview, arguments, return value, and errors. It is somewhat redundant with the schema's parameter descriptions, but the added details earn their place and the opening sentence front-loads the core purpose.

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

Completeness5/5

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

The description is complete for this CLI-wrapper tool: it covers the command being run, all parameter defaults and behaviors, the return structure, and failure modes. An agent has everything needed to invoke the tool correctly without relying on external documentation.

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. The description adds meaningful value beyond the schema by explaining that `path` searches the system PATH and the DIFFBLUE_COVER_CLI environment variable, that `dcover_timeout=None` disables the timeout, and that `dry_run` avoids applying changes. These details help an agent call the tool correctly.

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 a specific verb and resource: 'Invoke Diffblue Cover to refactor the project' and identifies the exact command executed (`dcover refactor`). It also gives concrete example use cases ('fixing build issues or adding missing dependencies'), which makes the tool's purpose unmistakable and distinct from the sibling tools.

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 the tool: applying automated refactorings, fixing build issues, or adding missing dependencies. It does not explicitly contrast with the sibling tools `create` and `issues`, but it gives enough purpose-based guidance for an agent to select it appropriately.

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/diffblue/cover-mcp'

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