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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The ID or URL-encoded path of the project | |
| ref | Yes | The branch or tag name to run the pipeline for | |
| token | Yes | The trigger token | |
| variables | No | Variables to pass to the pipeline |
Implementation Reference
- src/handlers/cicd-handlers.ts:77-90 (handler)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); };
- src/utils/tools-data.ts:580-605 (schema)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'] } },
- src/utils/tool-registry.ts:55-55 (registration)Registration of the gitlab_trigger_pipeline tool in the central toolRegistry, mapping it to cicdHandlers.triggerPipeline.gitlab_trigger_pipeline: cicdHandlers.triggerPipeline,