Skip to main content
Glama

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
NameRequiredDescriptionDefault
jobFullNameYesFull path of the Jenkins job

Implementation Reference

  • 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");
    	}
    }
  • 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,
    },
  • 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"],
    },

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