Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idYes
job_idYes

Implementation Reference

  • 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)}"

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