Skip to main content
Glama

getBuild

Retrieve detailed information about specific Jenkins builds, including status, parameters, and artifacts, to monitor and analyze build execution.

Instructions

Get information about a specific build or the last build

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobFullNameYesFull path of the Jenkins job
buildNumberNoBuild number (optional, defaults to last build)

Implementation Reference

  • The main handler function that retrieves information about a specific Jenkins build or the last build using the Jenkins API.
    export async function getBuild(client, args) {
    	const { jobFullName, buildNumber = null } = args;
    	if (!jobFullName) return failure("getBuild", "jobFullName is required");
    	const jobPath = encodeJobPath(jobFullName);
    	const buildPath = buildNumber || "lastBuild";
    
    	try {
    		const response = await client.get(
    			`/job/${jobPath}/${buildPath}/api/json`
    		);
    		if (response.status === 200) {
    			return success("getBuild", { build: response.data });
    		}
    		return failure(
    			"getBuild",
    			`Build not found: ${jobFullName}#${buildPath}`,
    			{ statusCode: response.status }
    		);
    	} catch (error) {
    		return formatError(error, "getBuild");
    	}
  • Tool registration in the central registry, including input schema and handler reference. Used by getAllTools() for MCP server.
    getBuild: {
    	name: "getBuild",
    	description: "Get information about a specific build or the last build",
    	inputSchema: {
    		type: "object",
    		properties: {
    			jobFullName: {
    				type: "string",
    				description: "Full path of the Jenkins job",
    			},
    			buildNumber: {
    				type: "integer",
    				description:
    					"Build number (optional, defaults to last build)",
    			},
    		},
    		required: ["jobFullName"],
    	},
    	handler: getBuild,
    },

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/umishra1504/Jenkins-mcp-server'

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