Skip to main content
Glama
cuongdev

AWS CodePipeline MCP Server

by cuongdev

retry_stage

Retry a failed stage in an AWS CodePipeline execution to resume pipeline processing after failures.

Instructions

Retry a failed stage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline
stageNameYesName of the stage
pipelineExecutionIdYesExecution ID

Implementation Reference

  • The main handler function that executes the 'retry_stage' tool logic, calling AWS CodePipeline to retry the specified stage execution.
    export async function retryStage(
      codePipelineManager: CodePipelineManager, 
      input: {
        pipelineName: string;
        stageName: string;
        pipelineExecutionId: string;
      }
    ) {
      const { pipelineName, stageName, pipelineExecutionId } = input;
      const codepipeline = codePipelineManager.getCodePipeline();
      
      await codepipeline.retryStageExecution({
        pipelineName,
        stageName,
        pipelineExecutionId,
        retryMode: 'FAILED_ACTIONS'
      }).promise();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ 
              message: "Stage retry initiated successfully" 
            }, null, 2),
          },
        ],
      };
    }
  • The schema definition for the 'retry_stage' tool, specifying input parameters and validation.
    export const retryStageSchema = {
      name: "retry_stage",
      description: "Retry a failed stage",
      inputSchema: {
        type: "object",
        properties: {
          pipelineName: { 
            type: "string",
            description: "Name of the pipeline"
          },
          stageName: { 
            type: "string",
            description: "Name of the stage"
          },
          pipelineExecutionId: { 
            type: "string",
            description: "Execution ID"
          }
        },
        required: ["pipelineName", "stageName", "pipelineExecutionId"],
      },
    } as const;
  • src/index.ts:159-165 (registration)
    Registration and dispatch of the 'retry_stage' tool handler in the CallToolRequestHandler switch statement.
    case "retry_stage": {
      return await retryStage(codePipelineManager, input as {
        pipelineName: string;
        stageName: string;
        pipelineExecutionId: string;
      });
    }
  • src/index.ts:110-128 (registration)
    Registration of the 'retry_stage' schema (retryStageSchema) in the ListToolsRequestHandler, making it discoverable.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          listPipelinesSchema,
          getPipelineStateSchema,
          listPipelineExecutionsSchema,
          approveActionSchema,
          retryStageSchema,
          triggerPipelineSchema,
          getPipelineExecutionLogsSchema,
          stopPipelineExecutionSchema,
          // Add new tool schemas
          getPipelineDetailsSchema,
          tagPipelineResourceSchema,
          createPipelineWebhookSchema,
          getPipelineMetricsSchema,
        ],
      };
    });
  • src/index.ts:30-32 (registration)
    Import of the retryStage handler and retryStageSchema from the tool file.
      retryStage,
      retryStageSchema 
    } from "./tools/retry_stage.js";

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