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
| Name | Required | Description | Default |
|---|---|---|---|
| pipelineName | Yes | Name of the pipeline | |
| stageName | Yes | Name of the stage | |
| pipelineExecutionId | Yes | Execution ID |
Implementation Reference
- src/tools/retry_stage.ts:26-54 (handler)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), }, ], }; }
- src/tools/retry_stage.ts:3-24 (schema)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";