cancel_pipeline
Stop a running GitLab pipeline by specifying the project and pipeline ID. Use this tool to halt ongoing CI/CD processes when needed.
Instructions
Cancel a running pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| pipeline_id | Yes | Pipeline ID |
Implementation Reference
- src/handlers/pipelines.ts:87-98 (handler)The cancelPipeline handler function that executes the tool logic by calling the GitLab API to POST /projects/{project_id}/pipelines/{pipeline_id}/cancel and returns the JSON response.async cancelPipeline(args: PipelineActionParams) { const data = await this.client.post(`/projects/${encodeURIComponent(args.project_id)}/pipelines/${args.pipeline_id}/cancel`); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/pipelines.ts:140-157 (schema)The tool specification including name, description, and input schema requiring project_id (string) and pipeline_id (number).{ name: 'cancel_pipeline', description: 'Cancel a running pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, required: ['project_id', 'pipeline_id'], }, },
- src/server.ts:303-306 (registration)Tool call dispatching in the server's CallToolRequestSchema handler switch statement, routing 'cancel_pipeline' calls to pipelineHandlers.cancelPipeline.case "cancel_pipeline": return await this.pipelineHandlers.cancelPipeline( args as unknown as PipelineActionParams );