getJob
Retrieve detailed information about a specific Jenkins job, including its configuration, status, and build history, to monitor and manage 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 handler function that implements the core logic for the 'getJob' tool. It retrieves information about a specific Jenkins job by making an API call to `/job/{jobPath}/api/json`.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:133-147 (registration)The registration entry for the 'getJob' tool in the central tool registry, including name, description, input schema, and reference to the handler function.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, },
- src/tools/index.js:136-145 (schema)The input schema definition for the 'getJob' tool, specifying the required 'jobFullName' parameter.inputSchema: { type: "object", properties: { jobFullName: { type: "string", description: "Full path of the Jenkins job", }, }, required: ["jobFullName"], },