stop_pipeline
Stop a running Bitbucket pipeline by providing repository slug and pipeline UUID to halt execution and update status.
Instructions
Stop a running pipeline.
Args:
repo_slug: Repository slug
pipeline_uuid: Pipeline UUID
Returns:
Updated pipeline status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| pipeline_uuid | Yes |
Implementation Reference
- src/server.py:466-484 (handler)MCP tool handler function for 'stop_pipeline'. Registers the tool via @mcp.tool() decorator and implements the logic by calling BitbucketClient.stop_pipeline.def stop_pipeline(repo_slug: str, pipeline_uuid: str) -> dict: """Stop a running pipeline. Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID Returns: Updated pipeline status """ client = get_client() result = client.stop_pipeline(repo_slug, pipeline_uuid) return { "uuid": result.get("uuid"), "state": result.get("state", {}).get("name"), } # ==================== PIPELINE VARIABLE TOOLS ====================
- src/bitbucket_client.py:621-642 (helper)BitbucketClient helper method that performs the actual API POST request to stop the pipeline and fetches updated status.def stop_pipeline( self, repo_slug: str, pipeline_uuid: str ) -> dict[str, Any]: """Stop a running pipeline. Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID Returns: Updated pipeline info """ pipeline_uuid = ensure_uuid_braces(pipeline_uuid) result = self._request( "POST", self._repo_path(repo_slug, "pipelines", pipeline_uuid, "stopPipeline"), ) # 204 returns {} which is a success if result is None: raise BitbucketError(f"Failed to stop pipeline {pipeline_uuid}") # Return updated pipeline state return self.get_pipeline(repo_slug, pipeline_uuid) or {"stopped": True}
- src/server.py:466-466 (registration)The @mcp.tool() decorator registers the stop_pipeline function as an MCP tool with the name 'stop_pipeline'.def stop_pipeline(repo_slug: str, pipeline_uuid: str) -> dict: