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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/mcp_jenkins/server/queue.py:31-38 (handler)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}') - src/mcp_jenkins/server/queue.py:30-34 (registration)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 - tests/test_server/test_queue.py:48-51 (registration)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)