Skip to main content
Glama

get_queue_item

Retrieve a specific Jenkins queue item by its ID to inspect the details or status of a queued job.

Instructions

Get a specific item in Jenkins queue by id

Args: id: The id of the queue item

Returns: The queue item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual MCP tool handler for 'get_queue_item'. It is decorated with @mcp.tool(tags=['read']), fetches a queue item using the Jenkins rest client, and returns it as a dict via model_dump.
    @mcp.tool(tags=['read'])
    async def get_queue_item(ctx: Context, id: int) -> dict:
        """Get a specific item in Jenkins queue by id
    
        Args:
            id: The id of the queue item
    
        Returns:
            The queue item
        """
        item = jenkins(ctx).get_queue_item(id=id, depth=1)
        return item.model_dump(exclude_none=True)
  • Pydantic model (schema) for QueueItem, defining fields: id, inQueueSince, url, why, task (QueueItemTask). Used to validate/parse the API response.
    class QueueItem(BaseModel):
        id: int
        inQueueSince: int
        url: str
        why: str | None
    
        task: 'QueueItemTask'
    
    
    class QueueItemTask(BaseModel):
        fullDisplayName: str = None
        name: str = None
        url: str = None
  • Jenkins REST client method get_queue_item() that calls the Jenkins API endpoint (QUEUE_ITEM) and parses the response into a QueueItem model.
    def get_queue_item(self, *, id: int, depth: int = 0) -> 'QueueItem':
        """Get a queue item by its ID.
    
        Args:
            id: The ID of the queue item.
            depth: The depth of the information to retrieve.
    
        Returns:
            The QueueItem object.
        """
        response = self.request('GET', rest_endpoint.QUEUE_ITEM(id=id, depth=depth))
        return QueueItem.model_validate(response.json())
  • REST endpoint definition for QUEUE_ITEM used to construct the URL: 'queue/item/{id}/api/json?depth={depth}'
    QUEUE_ITEM = RestEndpoint('queue/item/{id}/api/json?depth={depth}')
  • The MCP server instance 'mcp' is created here, and the queue module is imported (line 34) so that the @mcp.tool decorator on get_queue_item registers it with the server.
    mcp = JenkinsMCP('mcp-jenkins', lifespan=lifespan)
    
    # Import tool modules to register them with the MCP server
    # This must happen after mcp is created so the @mcp.tool() decorators can reference it
    from mcp_jenkins.server import build, item, node, plugin, queue, view  # noqa: F401, E402
Behavior3/5

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

No annotations are provided. The description indicates a read operation ('get'), which is safe, but lacks details on permissions, error behavior, or what happens if the item doesn't exist.

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

Conciseness3/5

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

The description is short with a template-like structure (Args, Returns). It is not verbose, but could be more structured without redundancy.

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 output schema exists, the description does not need to detail return format. However, it omits common details like error states or prerequisites, leaving it moderately complete.

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 0%, but the description adds 'The id of the queue item' for the parameter. This provides basic context beyond the schema, though minimal.

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

Purpose5/5

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

The description clearly states it retrieves a specific Jenkins queue item by ID. It distinguishes itself from sibling tools like get_all_queue_items (list all) and cancel_queue_item (cancel).

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 for fetching a single item by id, but does not explicitly mention when to use versus alternatives or provide exclusions or conditions.

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/lanbaoshen/mcp-jenkins'

If you have feedback or need assistance with the MCP directory API, please join our Discord server