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
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project. | |
| pipelineId | Yes | The ID of the pipeline to cancel. |
Implementation Reference
- src/gitlab.service.ts:598-604 (handler)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'], },
- src/index.ts:1872-1886 (handler)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)}`, }, ], }; }
- src/index.ts:739-752 (schema)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'], },