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";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits such as permissions needed, whether it's idempotent, rate limits, or what happens on success/failure (e.g., does it restart the entire pipeline?). It mentions 'failed stage' but doesn't clarify if this applies to any failure type or has constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence ('Retry a failed stage'), which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool (retrying implies change) with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects, error handling, and what the tool returns, leaving significant gaps for an agent to understand how to use it effectively in context with sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (pipelineName, stageName, pipelineExecutionId) adequately. The description adds no additional meaning beyond what the schema provides, such as explaining relationships between parameters or usage examples, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Retry a failed stage' clearly states the action (retry) and target (failed stage), but it's vague about what constitutes a 'stage' and doesn't distinguish this tool from potential sibling operations like 'stop_pipeline_execution' or 'trigger_pipeline'. It specifies the resource but lacks detail on scope or mechanism.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'stop_pipeline_execution' or 'trigger_pipeline', nor does it mention prerequisites (e.g., the stage must be in a failed state). The description implies usage only for failed stages but offers no explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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