Skip to main content
Glama

get_build_status

Retrieve Jenkins build status by specifying the server name, job full name, and build number to monitor CI/CD pipeline progress and ensure build integrity.

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
build_numberYes
job_full_nameYes
server_nameYes

Implementation Reference

  • MCP tool handler for get_build_status, decorated with @mcp.tool(). Creates JenkinsAPIClient instance and delegates to client.get_build_status(job_full_name, build_number). This is the entry point for the MCP tool execution.
    @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 helper method in JenkinsAPIClient that performs the HTTP GET request to the Jenkins build API endpoint and parses the JSON response into a BuildInfo dictionary.
    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), }
  • TypedDict definition for BuildInfo, which specifies the structure of the output returned by get_build_status (number, result, building, url, timestamp, duration).
    class BuildInfo(TypedDict): """Build info.""" number: int result: Optional[str] building: bool url: str timestamp: int duration: int

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