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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pipelineName": "<pipelineName>",
"stageName": "<stageName>",
"actionName": "<actionName>",
"token": "<token>",
"approved": "<approved>"
},
"name": "approve_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipelineName | Yes | Name of the pipeline | |
| stageName | Yes | Name of the stage | |
| actionName | Yes | Name of the action | |
| token | Yes | Approval token | |
| approved | Yes | Boolean indicating approval or rejection | |
| comments | No | Optional comments |
Implementation Reference
- src/tools/approve_action.ts:38-73 (handler)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), }, ], }; } - src/tools/approve_action.ts:3-36 (schema)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;