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
| Name | Required | Description | Default |
|---|---|---|---|
| jobFullName | Yes | Full path of the Jenkins job | |
| buildNumber | No | Build number (optional, defaults to last build) |
Implementation Reference
- src/tools/job-info.js:36-56 (handler)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"); }
- src/tools/index.js:149-168 (registration)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, },