Skip to main content
Glama
mdtahmidhossain

jenkins-http-mcp-server

jenkins_get_build

Retrieve a specific Jenkins build by its number or permalink (e.g., lastBuild) to inspect details and logs.

Instructions

Get a build by number or Jenkins permalink such as lastBuild.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobYes
buildYes
treeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual MCP tool handler for 'jenkins_get_build'. Decorated with @mcp.tool(), it takes a job path and build number/permalink, optionally a tree filter, and returns JSON data from the Jenkins build API.
    @mcp.tool()
    def jenkins_get_build(
        job: str | list[str],
        build: int | str,
        tree: str | None = None,
    ) -> dict[str, Any]:
        """Get a build by number or Jenkins permalink such as lastBuild."""
        return _run(lambda: _get_json(_build_path(job, build), params=_query(tree)))
  • The 'register_tools' function that decorates all tools with @mcp.tool() (line 55). All tool definitions including jenkins_get_build are nested inside this function.
    def register_tools(mcp: FastMCP) -> None:
  • The READ_ONLY_TOOLS list that includes 'jenkins_get_build' (line 359), registering 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",
    ]
  • The _build_path helper function used by jenkins_get_build to construct the URL path for a specific build by combining job_path and safe_segment.
    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 job_path helper that converts a job name or list of path segments into a Jenkins API URL path (e.g., 'job/MyJob/job/subfolder'). Used by _build_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)
Behavior3/5

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

No annotations provided, so the description carries the burden. It states the tool gets a build, which is read-only by implication. Adding the acceptance of permalinks provides some behavioral context. However, it does not disclose error behavior or safety beyond the verb.

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

Conciseness5/5

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

One sentence, front-loaded with action and resource, no unnecessary words. Perfectly concise.

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

Completeness3/5

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

Given the presence of an output schema and three parameters, the description covers the core selection of a build but omits details about the 'job' and 'tree' parameters. For a getter tool, it is adequate but not fully complete.

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?

Schema description coverage is 0%, so the description must add value. It clarifies that the 'build' parameter can be an integer or string (permalink). It does not explain 'job' (which can be string or array) or 'tree'. This adds partial meaning but leaves gaps.

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 uses specific verb 'Get' and resource 'build', and explicitly distinguishes the tool by mentioning two ways to specify the build (by number or Jenkins permalink), which differentiates it from siblings like 'list_builds' or 'get_build_artifacts'.

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 usage: use this when you have a specific build number or permalink. It does not explicitly state when not to use it or mention alternatives among siblings, but the purpose is clear enough for basic guidance.

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