Skip to main content
Glama

getJobs

Retrieve a paginated list of Jenkins jobs to view and manage automation workflows, with options to filter by folder and control result display.

Instructions

Get a paginated list of Jenkins jobs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentFullNameNoFull path of the parent folder (optional)
skipNoNumber of items to skip (default: 0)
limitNoMaximum number of items to return (default: 10, max: 10)

Implementation Reference

  • The handler function for the 'getJobs' tool. Fetches a list of Jenkins jobs from the specified parent folder (or root), sorts them alphabetically, applies pagination based on skip and limit parameters, and returns a formatted success response with the jobs list, total count, skip, and limit values. Handles errors appropriately.
    export async function getJobs(client, args = {}) {
    	let { parentFullName = "", skip = 0, limit = 10 } = args;
    	skip = Math.max(0, parseInt(skip, 10) || 0);
    	limit = Math.min(10, Math.max(1, parseInt(limit, 10) || 10));
    	const basePath = parentFullName
    		? `/job/${encodeJobPath(parentFullName)}`
    		: "";
    
    	try {
    		const response = await client.get(
    			`${basePath}/api/json?tree=jobs[name,url,description,buildable,color]`
    		);
    		if (response.status === 200) {
    			const jobs = response.data.jobs || [];
    			const sortedJobs = jobs.sort((a, b) =>
    				a.name.localeCompare(b.name)
    			);
    			const paginatedJobs = sortedJobs.slice(skip, skip + limit);
    			return success("getJobs", {
    				jobs: paginatedJobs,
    				total: jobs.length,
    				skip,
    				limit,
    			});
    		}
    		return failure("getJobs", "Failed to get jobs", {
    			statusCode: response.status,
    		});
    	} catch (error) {
    		return formatError(error, "getJobs");
    	}
    }
  • The registration of the 'getJobs' tool in the central tool registry. Includes the tool name, description, input schema for parameters (parentFullName, skip, limit), and reference to the handler function imported from job-info.js.
    getJobs: {
    	name: "getJobs",
    	description: "Get a paginated list of Jenkins jobs",
    	inputSchema: {
    		type: "object",
    		properties: {
    			parentFullName: {
    				type: "string",
    				description: "Full path of the parent folder (optional)",
    			},
    			skip: {
    				type: "integer",
    				description: "Number of items to skip (default: 0)",
    			},
    			limit: {
    				type: "integer",
    				description:
    					"Maximum number of items to return (default: 10, max: 10)",
    			},
    		},
    	},
    	handler: getJobs,
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions pagination, which is useful, but fails to describe key traits like whether this is a read-only operation (implied but not stated), potential rate limits, authentication needs, or the format of returned data (e.g., job names, statuses). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action ('Get a paginated list of Jenkins jobs'), making it easy to parse. Every part of the sentence contributes essential information, earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (list operation with pagination), no annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose and hints at pagination but lacks details on return values, error handling, or behavioral constraints. For a tool with no structured output, more context would be beneficial to fully understand its operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, providing clear details for all three parameters (parentFullName, skip, limit). The description adds no additional parameter semantics beyond what's in the schema, such as examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately documents parameters without needing extra description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('paginated list of Jenkins jobs'), making the purpose unambiguous. It distinguishes itself from siblings like 'getJob' (singular) by specifying it returns a list. However, it doesn't explicitly differentiate from other list-like tools (e.g., 'getQueueInfo') beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. While it's clear this is for listing jobs, there's no mention of when to use it over other job-related tools like 'getJob' (for single job details) or 'getQueueInfo' (for queue status). The description lacks context about prerequisites, typical use cases, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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