Skip to main content
Glama

getQueueItem

Retrieve details of a specific queued Jenkins job to check if it has transitioned to an active build, using the queue ID from a previously triggered build.

Instructions

Get a specific queued item by queueId and see whether it transitioned to a build

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queueIdYesQueue item ID (from triggerBuild result)

Implementation Reference

  • The main handler function that implements the getQueueItem tool logic, fetching details of a specific queue item from the Jenkins API and checking if it has transitioned to a build.
    export async function getQueueItem(client, args = {}) {
    	const { queueId } = args;
    	if (queueId === undefined || queueId === null) {
    		return failure("getQueueItem", "queueId is required");
    	}
    	try {
    		const res = await client.get(
    			`${client.baseUrl}/queue/item/${queueId}/api/json`
    		);
    		if (res.status === 200) {
    			// Determine if it has transitioned to a build
    			const executable = res.data?.executable;
    			return success("getQueueItem", {
    				queueId,
    				blocked: res.data?.blocked || false,
    				buildable: res.data?.buildable !== false,
    				stuck: res.data?.stuck || false,
    				why: res.data?.why || "Waiting",
    				params: res.data?.params,
    				taskName: res.data?.task?.name,
    				taskUrl: res.data?.task?.url,
    				executable: executable
    					? {
    							number: executable.number,
    							url: executable.url,
    					  }
    					: null,
    				transitioned: Boolean(executable),
    			});
    		}
    		return failure("getQueueItem", `Queue item not found: ${queueId}`, {
    			statusCode: res.status,
    		});
    	} catch (error) {
    		return formatError(error, "getQueueItem");
    	}
    }
  • The tool registration entry in the central registry, including name, description, input schema, and reference to the handler function.
    getQueueItem: {
    	name: "getQueueItem",
    	description:
    		"Get a specific queued item by queueId and see whether it transitioned to a build",
    	inputSchema: {
    		type: "object",
    		properties: {
    			queueId: {
    				type: "integer",
    				description: "Queue item ID (from triggerBuild result)",
    			},
    		},
    		required: ["queueId"],
    	},
    	handler: getQueueItem,
  • The input schema defining the expected parameters for the getQueueItem tool (queueId as integer).
    inputSchema: {
    	type: "object",
    	properties: {
    		queueId: {
    			type: "integer",
    			description: "Queue item ID (from triggerBuild result)",
    		},
    	},
    	required: ["queueId"],
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions checking transition to a build, which adds behavioral context beyond basic retrieval. However, it lacks details on permissions, error handling, rate limits, or what 'see whether it transitioned' entails in the response, leaving significant gaps for a tool with mutation implications.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core action. It could be slightly more structured by separating purpose from behavioral context, but it avoids redundancy and wastes no words.

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 no annotations and no output schema, the description is moderately complete for a simple retrieval tool. It covers purpose and hints at behavioral outcome (transition check), but lacks details on response format, error cases, or integration with siblings like triggerBuild, leaving room for improvement in guiding the agent.

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?

Schema description coverage is 100%, with queueId documented as 'Queue item ID (from triggerBuild result)'. The description adds minimal value beyond this, only reiterating 'by queueId' without explaining format or constraints further. Baseline 3 is appropriate as the schema adequately covers the single parameter.

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 'queued item', specifying retrieval of a specific item by queueId. It distinguishes from siblings like getBuild or getQueueInfo by focusing on queued items rather than builds or queue metadata. However, it doesn't explicitly contrast with all relevant siblings like getStatus.

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

Usage Guidelines3/5

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

The description implies usage when you need to check a queued item's transition to a build, suggesting context after triggerBuild. It doesn't provide explicit when-not-to-use guidance or name alternatives like getBuild for already-transitioned items, leaving some ambiguity about optimal tool selection among siblings.

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