Skip to main content
Glama

retry_pipeline

Restart a failed GitLab CI/CD pipeline by specifying the project and pipeline ID to resume automated testing and deployment processes.

Instructions

重試 Pipeline

Args: project_id: 專案 ID 或路徑 pipeline_id: Pipeline ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
pipeline_idYes

Implementation Reference

  • The handler for the retry_pipeline tool, which calls the GitLab client to perform the API request.
    def retry_pipeline(project_id: int | str, pipeline_id: int) -> str:
        """重試 Pipeline
    
        Args:
            project_id: 專案 ID 或路徑
            pipeline_id: Pipeline ID
        """
        try:
            client = get_client()
            p = client.retry_pipeline(project_id, pipeline_id)
            return f"✓ Pipeline #{p['id']} 已重試 | 狀態: {p.get('status', 'N/A')}"
        except GitLabAPIError as e:
            return f"重試 Pipeline 失敗: {str(e)}"
  • Registration of the retry_pipeline function as an MCP tool.
    @mcp.tool()
  • The GitLab client method that executes the POST request to retry a pipeline.
    def retry_pipeline(self, project_id: int | str, pipeline_id: int) -> dict:
        """POST /projects/:id/pipelines/:pipeline_id/retry"""
        pid = self._resolve_project_id(project_id)
        return self._post_json(f"/projects/{pid}/pipelines/{pipeline_id}/retry")

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/snowild/gitlab-mcp'

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