retry_job
Retry a failed GitLab CI/CD job by specifying project and job IDs to restart execution and resolve pipeline issues.
Instructions
重試單一 Job
Args: project_id: 專案 ID 或路徑 job_id: Job ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| job_id | Yes |
Implementation Reference
- src/gitlab_mcp/server.py:741-754 (handler)The `retry_job` tool is registered as an MCP tool using `@mcp.tool()` and handles the request by calling the GitLab client.
@mcp.tool() def retry_job(project_id: int | str, job_id: int) -> str: """重試單一 Job Args: project_id: 專案 ID 或路徑 job_id: Job ID """ try: client = get_client() j = client.retry_job(project_id, job_id) return f"✓ Job #{j['id']} ({j.get('name', 'N/A')}) 已重試 | 狀態: {j.get('status', 'N/A')}" except GitLabAPIError as e: return f"重試 Job 失敗: {str(e)}"