retry_stage
Retry a failed stage in AWS CodePipeline by specifying the pipeline name, stage name, and execution ID. Simplifies pipeline management and reduces manual intervention.
Instructions
Retry a failed stage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipelineExecutionId | Yes | Execution ID | |
| pipelineName | Yes | Name of the pipeline | |
| stageName | Yes | Name of the stage |
Implementation Reference
- src/tools/retry_stage.ts:26-54 (handler)The core handler function for the MCP 'retry_stage' tool that uses AWS SDK to retry a failed stage in CodePipeline.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), }, ], }; }
- src/tools/retry_stage.ts:3-24 (schema)Input schema definition for the 'retry_stage' MCP tool, specifying required parameters.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)Dispatch/registration of the 'retry_stage' handler within the MCP CallToolRequestHandler switch case.case "retry_stage": { return await retryStage(codePipelineManager, input as { pipelineName: string; stageName: string; pipelineExecutionId: string; }); }
- src/index.ts:117-117 (registration)Inclusion of 'retryStageSchema' in the listTools response for tool discovery.retryStageSchema,