Skip to main content
Glama

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
NameRequiredDescriptionDefault
repo_slugYes
pipeline_uuidYes

Implementation Reference

  • 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 ====================
  • 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:

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/JaviMaligno/mcp-server-bitbucket'

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