Skip to main content
Glama

gitlab_cancel_pipeline

Cancel a running GitLab pipeline by specifying the project path and pipeline ID. Use this tool to stop ongoing CI/CD processes when needed.

Instructions

Cancels a running pipeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesThe path of the GitLab project.
pipelineIdYesThe ID of the pipeline to cancel.

Implementation Reference

  • The core handler function in GitLabService that cancels a running GitLab pipeline by making a POST request to the GitLab API /pipelines/{id}/cancel endpoint.
    async cancelPipeline(projectPath: string, pipelineId: number): Promise<any> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      return this.callGitLabApi<any>(
        `projects/${encodedProjectPath}/pipelines/${pipelineId}/cancel`,
        'POST',
      );
    }
  • src/index.ts:736-752 (registration)
    Tool registration in the allTools array, defining the name, description, and input schema for gitlab_cancel_pipeline.
    {
      name: 'gitlab_cancel_pipeline',
      description: 'Cancels a running pipeline.',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'The path of the GitLab project.',
          },
          pipelineId: {
            type: 'number',
            description: 'The ID of the pipeline to cancel.',
          },
        },
        required: ['projectPath', 'pipelineId'],
      },
  • Dispatch handler in the CallToolRequestSchema switch statement that extracts arguments and calls the GitLabService.cancelPipeline method.
    case 'gitlab_cancel_pipeline': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectPath, pipelineId } = args as { projectPath: string; pipelineId: number };
      const result = await gitlabService.cancelPipeline(projectPath, pipelineId);
      return {
        content: [
          {
            type: 'text',
            text: `Pipeline cancelled successfully: ${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Input schema defining the parameters for the gitlab_cancel_pipeline tool: projectPath (string) and pipelineId (number).
    inputSchema: {
      type: 'object',
      properties: {
        projectPath: {
          type: 'string',
          description: 'The path of the GitLab project.',
        },
        pipelineId: {
          type: 'number',
          description: 'The ID of the pipeline to cancel.',
        },
      },
      required: ['projectPath', 'pipelineId'],
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Cancels') but lacks critical details: whether this requires specific permissions, if the cancellation is reversible, what happens to associated jobs, or any rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient. This is an example of optimal conciseness for a simple 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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or error conditions, nor does it explain what the tool returns. For a tool that alters system state, more context is needed to use it effectively.

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 100%, with both parameters ('projectPath' and 'pipelineId') clearly documented in the schema. The description adds no additional semantic context about these parameters, such as format examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't enhance understanding.

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 ('Cancels') and resource ('a running pipeline'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gitlab_retry_pipeline' or 'gitlab_trigger_pipeline' beyond the basic verb, missing an opportunity to clarify its specific role in pipeline management.

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. It doesn't mention prerequisites (e.g., pipeline must be running), exclusions (e.g., cannot cancel completed pipelines), or related tools like 'gitlab_retry_pipeline' for restarting after cancellation. This leaves the agent with minimal context for decision-making.

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/HainanZhao/mcp-gitlab-jira'

If you have feedback or need assistance with the MCP directory API, please join our Discord server