Skip to main content
Glama
mdtahmidhossain

jenkins-http-mcp-server

jenkins_get_test_report

Retrieve JSON test report from a Jenkins job build that provides test results via plugins such as JUnit.

Instructions

Get /testReport/api/json when a test-report plugin such as JUnit provides it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobYes
buildYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'jenkins_get_test_report' tool. It builds the path using _build_path and appends '/testReport', then fetches JSON via _get_json. The actual API call goes to Jenkins /testReport/api/json.
    @mcp.tool()
    def jenkins_get_test_report(job: str | list[str], build: int | str) -> dict[str, Any]:
        """Get /testReport/api/json when a test-report plugin such as JUnit provides it."""
        return _run(lambda: _get_json(f"{_build_path(job, build)}/testReport"))
  • Tool registration: the @mcp.tool() decorator on line 160 registers 'jenkins_get_test_report' as an MCP tool.
    @mcp.tool()
    def jenkins_get_test_report(job: str | list[str], build: int | str) -> dict[str, Any]:
        """Get /testReport/api/json when a test-report plugin such as JUnit provides it."""
        return _run(lambda: _get_json(f"{_build_path(job, build)}/testReport"))
  • The tool name is listed in the READ_ONLY_TOOLS list at line 362, grouping it with other read-only tools.
    READ_ONLY_TOOLS = [
        "jenkins_whoami",
        "jenkins_version",
        "jenkins_health",
        "jenkins_get_json",
        "jenkins_list_jobs",
        "jenkins_get_job",
        "jenkins_get_job_config",
        "jenkins_list_builds",
        "jenkins_get_build",
        "jenkins_get_build_log",
        "jenkins_get_build_artifacts",
        "jenkins_get_test_report",
        "jenkins_list_queue",
        "jenkins_get_queue_item",
        "jenkins_list_views",
        "jenkins_get_view",
        "jenkins_list_nodes",
        "jenkins_get_node",
        "jenkins_list_plugins",
    ]
  • The _build_path helper constructs the Jenkins job/build path segment used by the handler.
    def _build_path(job: str | list[str], build: int | str) -> str:
        build_id = str(build)
        if not build_id or build_id in {".", ".."} or "/" in build_id:
            from .errors import PathValidationError
    
            raise PathValidationError("build must be a number or permalink path segment")
        return f"{job_path(job)}/{safe_segment(build_id, 'build')}"
  • The get_json method on JenkinsClient that the handler ultimately calls to fetch the test report JSON from the Jenkins API.
    def get_json(self, path: str, params: Mapping[str, Any] | None = None) -> Json:
        response = self.request("GET", append_api_json(path), params=params)
        try:
            payload = response.json()
        except json.JSONDecodeError as exc:
            raise JenkinsHTTPError(
                response.status_code,
                "GET",
                normalize_relative_path(path),
                "Response was not JSON",
                _body_snippet(response),
            ) from exc
        return payload
Behavior2/5

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

No annotations provided, so description must cover behavioral traits. It mentions plugin dependency but fails to disclose error behavior if plugin is missing, authentication needs, or that it's a read-only operation. The description is insufficient for an agent to understand side effects or prerequisites.

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?

Single sentence is concise and front-loads the action. However, it could be more structured with separate lines for clarity. No unnecessary words.

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

Completeness2/5

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

Given the lack of annotations and low schema coverage, the description should compensate but does not. It omits details like required parameters (though schema indicates), array handling for job, and what the output contains (despite an output schema existing). The description is too minimal for safe invocation.

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

Parameters1/5

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

Schema has 2 parameters with 0% coverage. Description does not explain what 'job' and 'build' mean (e.g., job name, build number or URL). No additional semantic context is provided beyond the schema field names.

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

Purpose4/5

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

Description clearly states it gets the test report from a specific API endpoint when a plugin provides it. Verb 'Get' and resource 'test report' are specific, and it distinguishes from sibling tools like 'jenkins_get_build' by focusing on test reports.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. Does not mention prerequisites or when to avoid it. For example, it's only useful if a test report plugin is installed, but this is not explicitly stated as a usage condition.

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/mdtahmidhossain/jenkins-http-mcp-server'

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