cancel_pipeline
Stop a running GitLab pipeline by specifying the project and pipeline ID to halt execution and prevent further resource consumption.
Instructions
Cancel a running pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipeline_id | Yes | Pipeline ID | |
| project_id | Yes | Project ID or path |
Implementation Reference
- src/handlers/pipelines.ts:87-98 (handler)The core handler function for the 'cancel_pipeline' tool. It makes a POST request to the GitLab API to cancel the pipeline 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/types.ts:377-380 (schema)TypeScript interface defining the input parameters for pipeline actions, including cancel_pipeline.export interface PipelineActionParams { project_id: string; pipeline_id: number; }
- src/tools/pipelines.ts:140-157 (registration)Tool registration definition including name, description, and input JSON schema.{ 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)Server switch case that routes calls to the cancel_pipeline tool to the appropriate handler.case "cancel_pipeline": return await this.pipelineHandlers.cancelPipeline( args as unknown as PipelineActionParams );