Skip to main content
Glama

cancel_pipeline

Stop a running CI/CD pipeline in GitLab by providing project and pipeline IDs to halt ongoing builds and deployments.

Instructions

取消 Pipeline

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
pipeline_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler for cancel_pipeline in the MCP server.
    def cancel_pipeline(project_id: int | str, pipeline_id: int) -> str:
        """取消 Pipeline
    
        Args:
            project_id: 專案 ID 或路徑
            pipeline_id: Pipeline ID
        """
        try:
            client = get_client()
            p = client.cancel_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 cancel_pipeline tool.
    @mcp.tool()
  • The underlying GitLab API client method called by the MCP tool.
    def cancel_pipeline(self, project_id: int | str, pipeline_id: int) -> dict:
        """POST /projects/:id/pipelines/:pipeline_id/cancel"""
        pid = self._resolve_project_id(project_id)
        return self._post_json(f"/projects/{pid}/pipelines/{pipeline_id}/cancel")
Behavior1/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 only states the action ('取消 Pipeline') without explaining what cancellation does (e.g., stops execution, sets status to canceled), permissions required, side effects, or response behavior. This is inadequate for a mutation tool with zero annotation coverage.

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

Conciseness3/5

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

The description is brief with a clear header and parameter list, but it's under-specified rather than concise. The first line '取消 Pipeline' is redundant, and the parameter explanations are minimal. While structured, it lacks essential information that would justify its brevity for a mutation tool.

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

Completeness2/5

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

Given the tool's complexity (a mutation with 2 parameters), no annotations, 0% schema coverage, but with an output schema, the description is incomplete. It doesn't cover behavioral aspects like effects, permissions, or error conditions. The output schema may help with return values, but the description fails to provide necessary context for safe and correct usage.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It lists parameters ('project_id: 專案 ID 或路徑', 'pipeline_id: Pipeline ID') but adds minimal meaning beyond the schema's titles ('Project Id', 'Pipeline Id'). The Chinese note for project_id ('專案 ID 或路徑') hints it can be an ID or path, but this is already implied by the schema's anyOf type. It doesn't explain format, constraints, or relationships between parameters.

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

Purpose2/5

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

The description states '取消 Pipeline' (Cancel Pipeline), which is a tautology that merely restates the tool name in Chinese. While it indicates the action and resource, it lacks specificity about what cancellation entails (e.g., stopping execution, marking as failed) and doesn't distinguish it from sibling tools like 'retry_pipeline' or 'get_pipeline'. This provides minimal clarity beyond the name.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., pipeline must be running), exclusions (e.g., cannot cancel completed pipelines), or comparisons to siblings like 'retry_pipeline' or 'create_pipeline'. This leaves the agent with no contextual usage information.

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