Skip to main content
Glama

gitlab_trigger_pipeline

Trigger a new GitLab CI/CD pipeline for a specific branch or ref to automate code testing and deployment processes.

Instructions

Triggers a new pipeline for a specific branch/ref.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesThe path of the GitLab project.
refYesThe branch or ref to trigger the pipeline for.
variablesNoOptional: Pipeline variables as key-value pairs.

Implementation Reference

  • Core handler function implementing the gitlab_trigger_pipeline tool. Posts to GitLab API to create a new pipeline for the specified project and ref, with optional variables.
    // New tool: Trigger Pipeline
    async triggerPipeline(projectPath: string, ref: string, variables?: Record<string, string>): Promise<any> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      const body: any = { ref };
      if (variables) {
        body.variables = Object.entries(variables).map(([key, value]) => ({ key, value }));
      }
      return this.callGitLabApi<any>(
        `projects/${encodedProjectPath}/pipeline`,
        'POST',
        body,
      );
    }
  • src/index.ts:697-717 (registration)
    Registers the gitlab_trigger_pipeline tool in the MCP tools list, including name, description, and input schema.
      name: 'gitlab_trigger_pipeline',
      description: 'Triggers a new pipeline for a specific branch/ref.',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'The path of the GitLab project.',
          },
          ref: {
            type: 'string',
            description: 'The branch or ref to trigger the pipeline for.',
          },
          variables: {
            type: 'object',
            description: 'Optional: Pipeline variables as key-value pairs.',
          },
        },
        required: ['projectPath', 'ref'],
      },
    },
  • src/index.ts:1840-1854 (registration)
    Dispatch handler in the MCP server request handler that calls the GitLab service's triggerPipeline method for the gitlab_trigger_pipeline tool.
    case 'gitlab_trigger_pipeline': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectPath, ref, variables } = args as { projectPath: string; ref: string; variables?: Record<string, string> };
      const result = await gitlabService.triggerPipeline(projectPath, ref, variables);
      return {
        content: [
          {
            type: 'text',
            text: `Pipeline triggered successfully: ${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action ('Triggers') implying a write operation, but doesn't disclose permissions needed, rate limits, side effects (e.g., starting CI/CD jobs), or what happens on failure. This leaves significant gaps for a mutation tool.

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 and scannable.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., pipeline ID, status), error conditions, or behavioral nuances like how variables affect pipeline execution. More context is needed for safe and effective use.

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%, so parameters are well-documented in the schema itself. The description adds no additional meaning about parameters beyond implying 'branch/ref' usage, which is already covered. Baseline 3 is appropriate as the schema does the heavy lifting.

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 ('Triggers') and resource ('new pipeline for a specific branch/ref'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like gitlab_retry_pipeline or gitlab_cancel_pipeline, which also operate on pipelines but with different intents.

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., needing a valid project path or branch), nor does it contrast with related tools like gitlab_retry_pipeline (for existing pipelines) or gitlab_get_project_pipelines (for viewing).

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