Skip to main content
Glama

gitlab_trigger_pipeline

Initiate a pipeline execution in GitLab by specifying the project, branch, and trigger token. Pass custom variables to control the pipeline flow efficiently.

Instructions

Trigger a pipeline run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe ID or URL-encoded path of the project
refYesThe branch or tag name to run the pipeline for
tokenYesThe trigger token
variablesNoVariables to pass to the pipeline

Implementation Reference

  • The main handler function for gitlab_trigger_pipeline tool. Validates inputs and calls context.ciCdManager.triggerPipeline to execute the pipeline trigger.
    export const triggerPipeline: ToolHandler = async (params, context) => {
      const { project_id, ref, token, variables } = params.arguments || {};
      if (!project_id || !ref || !token) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id, ref, and token are required');
      }
      
      const data = await context.ciCdManager.triggerPipeline(
        project_id as string | number, 
        ref as string, 
        token as string, 
        variables as Record<string, string> | undefined
      );
      return formatResponse(data);
    };
  • Input schema definition for the gitlab_trigger_pipeline tool, specifying parameters and validation rules.
      name: 'gitlab_trigger_pipeline',
      description: 'Trigger a pipeline run',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          ref: {
            type: 'string',
            description: 'The branch or tag name to run the pipeline for'
          },
          token: {
            type: 'string',
            description: 'The trigger token'
          },
          variables: {
            type: 'object',
            description: 'Variables to pass to the pipeline',
            additionalProperties: { type: 'string' }
          }
        },
        required: ['project_id', 'ref', 'token']
      }
    },
  • Registration of the gitlab_trigger_pipeline tool in the central toolRegistry, mapping it to cicdHandlers.triggerPipeline.
    gitlab_trigger_pipeline: cicdHandlers.triggerPipeline,
Behavior2/5

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

No annotations are provided, so the description carries the full burden. 'Trigger a pipeline run' implies a write/mutation operation that starts a pipeline, but it doesn't disclose behavioral traits like whether this is asynchronous, what permissions are required, potential side effects (e.g., resource consumption), rate limits, or what happens on failure. This is a significant gap 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.

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 that triggers pipelines with 4 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or output expectations, leaving significant gaps for an AI agent to understand how to invoke it correctly.

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 the schema already documents all 4 parameters (project_id, ref, token, variables) with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining how variables are used or token requirements. Baseline 3 is appropriate when 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 'Trigger a pipeline run' clearly states the action (trigger) and resource (pipeline run) with a specific verb. It distinguishes from siblings like gitlab_list_projects or gitlab_create_merge_request_note by focusing on pipeline execution, though it doesn't explicitly differentiate from other pipeline-related tools (none are listed in siblings).

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 trigger token from gitlab_create_trigger_token), when not to use it, or how it relates to other pipeline or CI/CD tools in the sibling list.

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

Related 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/rifqi96/mcp-gitlab'

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