Skip to main content
Glama
by cuongdev

approve_action

Manually approve or reject pipeline actions in AWS CodePipeline by specifying pipeline, stage, action, token, and decision. Optional comments can be included for clarity.

Instructions

Approve or reject a manual approval action

Input Schema

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

Input Schema (JSON Schema)

{ "properties": { "actionName": { "description": "Name of the action", "type": "string" }, "approved": { "description": "Boolean indicating approval or rejection", "type": "boolean" }, "comments": { "description": "Optional comments", "type": "string" }, "pipelineName": { "description": "Name of the pipeline", "type": "string" }, "stageName": { "description": "Name of the stage", "type": "string" }, "token": { "description": "Approval token", "type": "string" } }, "required": [ "pipelineName", "stageName", "actionName", "token", "approved" ], "type": "object" }

Implementation Reference

  • The main handler function that executes the approve_action MCP tool. It calls AWS CodePipeline's putApprovalResult to approve or reject the action and returns a formatted response.
    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 schema definition for the approve_action tool, specifying input parameters and validation.
    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)
    Registration of the approve_action tool 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 tool schema in the MCP ListToolsRequestHandler, listing it among available tools.
    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 from the tools directory.
    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