Skip to main content
Glama
cuongdev
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";

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