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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)}"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('retry') but doesn't describe what 'retry' entails (e.g., re-executes a failed job, resets status, may have side effects), authentication requirements, rate limits, or what happens if the job isn't retriable. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately brief and front-loaded with the core purpose ('重試單一 Job'). The Args section is structured but minimal. There's no wasted text, though it could be more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), no annotations, and simple parameters, the description is minimally complete. However, for a mutation tool ('retry'), it lacks critical context like behavioral effects, error conditions, and usage distinctions from siblings, making it only adequate for basic understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantic labels ('專案 ID 或路徑' for project_id, 'Job ID' for job_id) in Chinese, which helps clarify what each parameter represents. However, it doesn't explain format expectations (e.g., project path syntax), constraints, or examples, leaving gaps for the agent to interpret.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('重試' meaning 'retry') and resource ('單一 Job' meaning 'single Job'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'retry_pipeline' or 'cancel_pipeline', which would require more specific context about what type of job is being retried.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (e.g., job must be in a failed state), when-not-to-use scenarios, or comparison to sibling tools like 'retry_pipeline' or 'get_job'. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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