getJob
Retrieve detailed information about Jenkins jobs including build status, configuration, and execution history for monitoring and automation workflows.
Instructions
Get information about a Jenkins job
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobFullName | Yes | Full path of the Jenkins job |
Implementation Reference
- src/tools/job-info.js:15-31 (handler)The main handler function that executes the getJob tool logic: validates jobFullName, encodes the job path, fetches job information from the Jenkins API, and returns formatted success or failure response.export async function getJob(client, args) { const { jobFullName } = args; if (!jobFullName) return failure("getJob", "jobFullName is required"); const jobPath = encodeJobPath(jobFullName); try { const response = await client.get(`/job/${jobPath}/api/json`); if (response.status === 200) { return success("getJob", { job: response.data }); } return failure("getJob", `Job not found: ${jobFullName}`, { statusCode: response.status, }); } catch (error) { return formatError(error, "getJob"); } }
- src/tools/index.js:136-145 (schema)Input schema definition for the getJob tool, specifying jobFullName as required string parameter.inputSchema: { type: "object", properties: { jobFullName: { type: "string", description: "Full path of the Jenkins job", }, }, required: ["jobFullName"], },
- src/tools/index.js:133-147 (registration)Tool registration in toolRegistry, including name, description, inputSchema, and reference to the handler function imported from job-info.js.getJob: { name: "getJob", description: "Get information about a Jenkins job", inputSchema: { type: "object", properties: { jobFullName: { type: "string", description: "Full path of the Jenkins job", }, }, required: ["jobFullName"], }, handler: getJob, },