Skip to main content
Glama

cancel_queue_item

Cancel a Jenkins queue item by its ID to stop it from processing.

Instructions

Cancel a specific item in Jenkins queue by id

Args: id: The id of the queue item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The MCP tool handler for cancel_queue_item. It is decorated with @mcp.tool(tags=['write']) and delegates to the Jenkins REST client.
    @mcp.tool(tags=['write'])
    async def cancel_queue_item(ctx: Context, id: int) -> None:
        """Cancel a specific item in Jenkins queue by id
    
        Args:
            id: The id of the queue item
        """
        jenkins(ctx).cancel_queue_item(id=id)
  • The Jenkins REST client method that performs the actual HTTP POST request to cancel a queue item.
    def cancel_queue_item(self, *, id: int) -> None:
        """Cancel a queue item by its ID.
    
        Args:
            id: The ID of the queue item to cancel.
        """
        self.request('POST', rest_endpoint.QUEUE_CANCEL_ITEM(id=id))
  • The REST endpoint definition for canceling a queue item: 'queue/cancelItem?id={id}'
    QUEUE_CANCEL_ITEM = RestEndpoint('queue/cancelItem?id={id}')
  • The MCP server initialization and the import that triggers tool registration via the @mcp.tool decorator in queue.py.
    @mcp.tool(tags=['write'])
    async def cancel_queue_item(ctx: Context, id: int) -> None:
        """Cancel a specific item in Jenkins queue by id
  • Test case confirming the cancel_queue_item tool calls the underlying Jenkins client correctly.
    @pytest.mark.asyncio
    async def test_cancel_queue_item(mock_jenkins, mocker):
        await queue.cancel_queue_item(mocker.Mock(), id=1)
        mock_jenkins.cancel_queue_item.assert_called_once_with(id=1)
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It states 'cancel' implying a destructive action, but does not mention side effects (e.g., whether the item is removed from queue, if it affects other items), permission requirements, or whether the action is reversible. This omission undermines safe tool use.

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 extremely concise: a single purpose sentence followed by a simple parameter listing. It is front-loaded with the action, and every sentence earns its place with no wasted 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 the simple tool (one parameter, no output schema), the description covers the basic purpose and parameter. However, it lacks behavioral context and usage guidance, which are important for agents to select and invoke it safely alongside sibling tools like stop_build and get_queue_item.

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 only parameter 'id' is documented in the description as 'The id of the queue item', which adds minimal meaning beyond the schema's type definition. With 0% schema description coverage, the description partially compensates, but fails to explain how to obtain the id or its format (e.g., integer, expected range).

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 the tool cancels a specific Jenkins queue item by id, using the verb 'cancel' and specifying the resource ('item in Jenkins queue'). This distinguishes it from sibling tools like get_queue_item (retrieval) and stop_build (stops a running build).

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. For example, it doesn't clarify when to cancel a queue item versus stopping a build, or prerequisites such as needing the queue item id from get_queue_item. The description lacks any usage context.

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