Skip to main content
Glama
xhuaustc

Jenkins MCP Tool

get_build_status

Retrieve Jenkins build status by specifying server name, job name, and build number to monitor CI/CD pipeline execution results.

Instructions

Get the Jenkins build status for the specified build_number.

Args:
    server_name: Jenkins server name
    job_full_name: Full job name
    build_number: Build number

Returns:
    Build status info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_nameYes
job_full_nameYes
build_numberYes

Implementation Reference

  • MCP tool handler for 'get_build_status', registered via @mcp.tool() decorator. Creates JenkinsAPIClient and delegates to its get_build_status method.
    @mcp.tool()
    def get_build_status(server_name: str, job_full_name: str, build_number: int) -> dict:
        """Get the Jenkins build status for the specified build_number.
    
        Args:
            server_name: Jenkins server name
            job_full_name: Full job name
            build_number: Build number
    
        Returns:
            Build status info
        """
        client = JenkinsAPIClient(server_name)
        return client.get_build_status(job_full_name, build_number)
  • Core implementation in JenkinsAPIClient that queries the Jenkins API for the specific build's JSON data and returns structured BuildInfo.
    def get_build_status(self, job_full_name: str, build_number: int) -> BuildInfo:
        """Get build status.
    
        Args:
            job_full_name: Full job name
            build_number: Build number
    
        Returns:
            Build info
    
        Raises:
            JenkinsBuildNotFoundError: Build not found
            JenkinsError: API request failed
        """
        job_url = self._build_job_url(job_full_name)
        api_url = f"{job_url}/{build_number}/api/json"
    
        response = self._make_request("GET", api_url)
    
        if response.status_code == 404:
            raise JenkinsBuildNotFoundError(
                build_number, job_full_name, self.server_name
            )
    
        response.raise_for_status()
        data = response.json()
    
        return {
            "number": data.get("number", build_number),
            "result": data.get("result"),
            "building": data.get("building", False),
            "url": data.get("url", ""),
            "timestamp": data.get("timestamp", 0),
            "duration": data.get("duration", 0),
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves status but doesn't describe what 'Build status info' includes (e.g., success/failure, duration, timestamps), potential errors (e.g., invalid build number), authentication needs, rate limits, or whether it's a read-only operation. This leaves significant gaps for a tool with no 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.

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first. The Args and Returns sections add structure, but the 'Returns' line is vague ('Build status info') and could be more informative. Overall, it's efficient with minimal waste, though slight improvements in clarity could enhance it further.

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 tool's complexity (3 parameters, no annotations, no output schema), the description is incomplete. It lacks details on return values (beyond 'Build status info'), error handling, authentication, and how it differs from siblings. For a status retrieval tool in a Jenkins context, this leaves the agent with insufficient information to use it effectively without trial and error.

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

Parameters3/5

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

The description lists all three parameters (server_name, job_full_name, build_number) in the Args section, adding meaning beyond the input schema, which has 0% description coverage. However, it only names them without explaining semantics (e.g., format of job_full_name, range for build_number). This partially compensates for the schema gap but doesn't fully clarify parameter usage, aligning with the baseline for moderate coverage improvement.

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?

The description clearly states the tool's purpose: 'Get the Jenkins build status for the specified build_number.' It specifies the verb ('Get'), resource ('Jenkins build status'), and scope ('for the specified build_number'). However, it doesn't explicitly differentiate from sibling tools like 'get_build_log' or 'get_job_parameters', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_build_log' (for logs) or 'trigger_build' (for initiating builds), nor does it specify prerequisites or contexts for usage. The only implied usage is retrieving status, but no explicit alternatives or exclusions are stated.

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/xhuaustc/jenkins-mcp'

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