Skip to main content
Glama
diffblue

Diffblue Cover MCP Server

Official
by diffblue

create

Generate JUnit tests for Java classes, methods, or packages by running Diffblue Cover CLI. Specify entry points or test the entire project.

Instructions

Invoke Diffblue Cover to generate unit tests for Java code.

This tool executes the dcover CLI to automatically generate JUnit tests for the specified Java classes, methods, or packages. It supports various configuration options to control the test generation process.

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). entry_points: List of fully-qualified Java targets (packages, classes, or methods) to generate tests for. Examples: ['com.example.MyClass', 'com.example.MyClass.myMethod']. If None, tests entire project. 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.

Note: If DIFFBLUE_COVER_OPTIONS environment variable is set, it overrides all option parameters (batch, skip_verification, etc.) except path, working_directory, timeout, and entry_points.

This tool requires a valid Diffblue Cover license. See:
https://docs.diffblue.com/features/cover-cli/commands-and-arguments#create-tests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoThe options to pass to dcover
pathNoThe path to the dcover executable
entry_pointsNoThe list of package names, class names, and/or methods to write tests for. The entries here should be fully qualified, in other words you must include the package and class names when specifying a method name.
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?

No annotations are provided, so the description carries the full behavioral disclosure burden. It thoroughly explains that this executes an external CLI, what the return structure is, what errors may occur, how timeouts are handled, and that environment variables can override options. It could explicitly mention filesystem side effects such as writing generated test files, but overall the behavior is well disclosed.

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 long but well organized into Args, Returns, Raises, and Notes sections. The leading purpose statement is clear and the subsequent detail is structured rather than a wall of text. A small amount of redundancy exists with return values repeated from the output schema, but it remains efficient for a complex CLI tool.

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?

Given the tool wraps an external CLI, the description is remarkably complete: it covers parameters, defaults, environment overrides, license requirements, error behavior, timeout semantics, and exact return fields. The output schema already exists, and the description still adds the important operational details an agent needs to invoke this tool correctly. Nothing essential is missing.

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 100% coverage of parameters, so the baseline is 3. The description adds meaningful detail beyond the schema: path searching behavior including DIFFBLUE_COVER_CLI, working_directory defaulting behavior, the implication of timeout=None, fully-qualified entry_point examples, and the effect of DIFFBLUE_COVER_OPTIONS. This elevates parameter understanding beyond the schema alone.

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 invoking Diffblue Cover to generate unit tests for Java code. The first sentence states a specific action and resource, and distinguishes this 'create' tool from the sibling tools 'refactor' and 'issues' by focusing on test generation.

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

Usage Guidelines3/5

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

The description implies when to use the tool: when you want to generate unit tests for Java code with dcover. However, it does not explicitly discuss when not to use it or how it compares to the sibling tools 'refactor' and 'issues'. The usage context is clear but alternative selection guidance is missing.

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