Skip to main content
Glama
cuongdev

AWS CodePipeline MCP Server

by cuongdev

stop_pipeline_execution

Stop an AWS CodePipeline execution by providing the pipeline name and execution ID to halt ongoing deployments or processes.

Instructions

Stop a pipeline execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline
executionIdYesExecution ID
reasonNoOptional reason for stopping

Implementation Reference

  • The core handler function that implements the stop_pipeline_execution MCP tool by invoking the AWS CodePipeline SDK to stop the specified pipeline execution and returning a success message.
    export async function stopPipelineExecution(
      codePipelineManager: CodePipelineManager, 
      input: {
        pipelineName: string;
        executionId: string;
        reason?: string;
      }
    ) {
      const { pipelineName, executionId, reason } = input;
      const codepipeline = codePipelineManager.getCodePipeline();
      
      await codepipeline.stopPipelineExecution({
        pipelineName,
        pipelineExecutionId: executionId,
        reason: reason || 'Stopped by user',
        abandon: false
      }).promise();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ 
              message: "Pipeline execution stopped successfully" 
            }, null, 2),
          },
        ],
      };
    }
  • The schema definition for the stop_pipeline_execution tool, specifying input parameters and requirements.
    export const stopPipelineExecutionSchema = {
      name: "stop_pipeline_execution",
      description: "Stop a pipeline execution",
      inputSchema: {
        type: "object",
        properties: {
          pipelineName: { 
            type: "string",
            description: "Name of the pipeline"
          },
          executionId: { 
            type: "string",
            description: "Execution ID"
          },
          reason: { 
            type: "string",
            description: "Optional reason for stopping"
          }
        },
        required: ["pipelineName", "executionId"],
      },
    } as const;
  • src/index.ts:45-47 (registration)
    Import statement bringing in the handler function and schema for the stop_pipeline_execution tool.
      stopPipelineExecution, 
      stopPipelineExecutionSchema 
    } from "./tools/stop_pipeline_execution.js";
  • src/index.ts:112-126 (registration)
    Registration of the stopPipelineExecutionSchema in the array of tools advertised by the MCP server's ListTools handler.
    tools: [
      listPipelinesSchema,
      getPipelineStateSchema,
      listPipelineExecutionsSchema,
      approveActionSchema,
      retryStageSchema,
      triggerPipelineSchema,
      getPipelineExecutionLogsSchema,
      stopPipelineExecutionSchema,
      // Add new tool schemas
      getPipelineDetailsSchema,
      tagPipelineResourceSchema,
      createPipelineWebhookSchema,
      getPipelineMetricsSchema,
    ],
  • src/index.ts:180-186 (registration)
    The switch case in the MCP CallToolRequestHandler that dispatches tool calls named 'stop_pipeline_execution' to the imported handler function.
    case "stop_pipeline_execution": {
      return await stopPipelineExecution(codePipelineManager, input as {
        pipelineName: string;
        executionId: string;
        reason?: string;
      });
    }

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/cuongdev/mcp-codepipeline-server'

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