Skip to main content
Glama
cuongdev

AWS CodePipeline MCP Server

by cuongdev

approve_action

Approve or reject manual approval actions in AWS CodePipeline stages to control pipeline progression and manage deployment workflows.

Instructions

Approve or reject a manual approval action

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline
stageNameYesName of the stage
actionNameYesName of the action
tokenYesApproval token
approvedYesBoolean indicating approval or rejection
commentsNoOptional comments

Implementation Reference

  • The async handler function that implements the core logic of approving or rejecting a CodePipeline manual approval action by calling putApprovalResult.
    export async function approveAction(
      codePipelineManager: CodePipelineManager, 
      input: {
        pipelineName: string;
        stageName: string;
        actionName: string;
        token: string;
        approved: boolean;
        comments?: string;
      }
    ) {
      const { pipelineName, stageName, actionName, token, approved, comments } = input;
      const codepipeline = codePipelineManager.getCodePipeline();
      
      await codepipeline.putApprovalResult({
        pipelineName,
        stageName,
        actionName,
        token,
        result: {
          status: approved ? 'Approved' : 'Rejected',
          summary: comments || ''
        }
      }).promise();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ 
              message: `Action ${approved ? 'approved' : 'rejected'} successfully` 
            }, null, 2),
          },
        ],
      };
    }
  • The input schema definition for the approve_action tool, including parameters and requirements.
    export const approveActionSchema = {
      name: "approve_action",
      description: "Approve or reject a manual approval action",
      inputSchema: {
        type: "object",
        properties: {
          pipelineName: { 
            type: "string",
            description: "Name of the pipeline"
          },
          stageName: { 
            type: "string",
            description: "Name of the stage"
          },
          actionName: { 
            type: "string",
            description: "Name of the action"
          },
          token: { 
            type: "string",
            description: "Approval token"
          },
          approved: { 
            type: "boolean",
            description: "Boolean indicating approval or rejection"
          },
          comments: { 
            type: "string",
            description: "Optional comments"
          }
        },
        required: ["pipelineName", "stageName", "actionName", "token", "approved"],
      },
    } as const;
  • src/index.ts:148-157 (registration)
    The dispatch/registration of the approve_action handler in the MCP CallToolRequestHandler switch statement.
    case "approve_action": {
      return await approveAction(codePipelineManager, input as {
        pipelineName: string;
        stageName: string;
        actionName: string;
        token: string;
        approved: boolean;
        comments?: string;
      });
    }
  • src/index.ts:110-128 (registration)
    Registration of the approve_action schema (line 116) in the MCP ListToolsRequestHandler.
    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:24-27 (registration)
    Import of the approveAction handler and approveActionSchema for registration in the main MCP server.
    import { 
      approveAction, 
      approveActionSchema 
    } from "./tools/approve_action.js";
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'approve or reject' implies a mutation, the description doesn't address permissions needed, whether the action is reversible, rate limits, or what happens upon success/failure. This leaves significant gaps for a tool that modifies pipeline states.

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 a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded, 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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after approval/rejection, error conditions, or how this interacts with other pipeline tools. Given the complexity of pipeline operations and lack of structured behavioral data, more context is needed.

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 6 parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema, such as explaining relationships between pipelineName, stageName, and actionName. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('approve or reject') and the resource ('a manual approval action'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential alternatives like 'get_pipeline_state' or 'retry_stage' that might also interact with pipeline actions, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'retry_stage' and 'stop_pipeline_execution' that also modify pipeline states, there's no indication of prerequisites, timing, or context for choosing 'approve_action' over other tools.

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