Skip to main content
Glama

getBuild

Retrieve detailed information about specific Jenkins builds or the last build for monitoring, analysis, and automation workflows.

Instructions

Get information about a specific build or the last build

Input Schema

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

Implementation Reference

  • The main handler function for the 'getBuild' tool. It retrieves information about a specific Jenkins build or the last build by making an API call to the Jenkins server, handling errors and validation.
    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"); } }
  • Input schema defining the parameters for the 'getBuild' tool: jobFullName (required string) and optional buildNumber (integer).
    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"], },
  • Registration of the 'getBuild' tool in the central tool registry, including name, description, input schema, and reference to the handler function.
    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