Skip to main content
Glama
mdtahmidhossain

jenkins-http-mcp-server

jenkins_list_builds

Retrieve recent builds for a Jenkins job to monitor build status, duration, and outcome.

Instructions

List recent builds for a job.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobYes
treeNobuilds[number,url,result,building,timestamp,duration]

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `jenkins_list_builds` tool handler function, decorated with `@mcp.tool()` inside `register_tools()`. It accepts a `job` path and optional `tree` parameter (defaulting to builds fields), calls `job_path()` to build the Jenkins API path, then fetches JSON from the job's API endpoint with the `tree` query parameter.
    @mcp.tool()
    def jenkins_list_builds(
        job: str | list[str],
        tree: str = "builds[number,url,result,building,timestamp,duration]",
    ) -> dict[str, Any]:
        """List recent builds for a job."""
        return _run(lambda: _get_json(job_path(job), params={"tree": tree}))
  • The `register_tools(mcp: FastMCP)` function that registers all tools including `jenkins_list_builds` via the `@mcp.tool()` decorator.
    def register_tools(mcp: FastMCP) -> None:
  • The `job_path()` helper function used by `jenkins_list_builds` to convert a job name (string or list) into a Jenkins API path.
    def job_path(job: str | list[str]) -> str:
        pieces = [piece for piece in job.split("/") if piece] if isinstance(job, str) else job
        if not pieces:
            raise PathValidationError("job must include at least one path segment")
    
        encoded: list[str] = []
        for piece in pieces:
            if not piece or piece in {".", ".."} or "/" in piece:
                raise PathValidationError("job path segments must be non-empty names")
            encoded.extend(["job", quote(piece, safe="")])
        return "/".join(encoded)
  • The `_get_json()` helper function used by `jenkins_list_builds` to execute the actual HTTP GET request to Jenkins.
    def _get_json(path: str, params: dict[str, Any] | None = None) -> Any:
        with _client() as client:
            return client.get_json(path, params=params)
  • The `READ_ONLY_TOOLS` list that includes `jenkins_list_builds`, marking it as a read-only tool.
    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",
    ]
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. It only says 'recent builds' but omits important behavioral details such as how many builds are returned, whether it is a read-only operation, what happens if the job doesn't exist, or the default ordering. The existence of the 'tree' parameter is not explained, leaving significant gaps for an agent.

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

Conciseness3/5

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

The description is very short (one sentence) and front-loaded with the key action. However, it may be too terse, sacrificing important context for brevity. While concise, it could be expanded without becoming verbose.

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 that there are two parameters and an output schema exists, the description is insufficient. It does not explain the 'tree' parameter's role in filtering output fields, nor does it provide any context on usage or prerequisites. The agent would have to rely on schema defaults and inference, which is risky.

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

Parameters2/5

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

Schema description coverage is 0%, requiring the description to add meaning. The description implicitly clarifies the 'job' parameter (job name or path) but does not mention the 'tree' parameter at all. Since the 'tree' parameter controls which fields are returned, its omission leaves the agent with incomplete parameter understanding.

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 action (list) and resource (recent builds for a job), which is specific enough to distinguish from other build-related tools. However, it does not explicitly differentiate from sibling tools like jenkins_get_build (for a single build) or provide context on what 'recent' means, so it falls short of a perfect 5.

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?

There is no guidance on when to use this tool versus alternatives. For instance, it does not mention that to get details of a specific build one should use jenkins_get_build, or to get build logs use jenkins_get_build_log. The description simply states what it does without any usage context.

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