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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| pipeline_id | Yes |
Implementation Reference
- src/gitlab_mcp/server.py:608-620 (handler)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)}" - src/gitlab_mcp/server.py:607-607 (registration)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")