get_pipeline_execution_logs
Retrieve execution logs for AWS CodePipeline to monitor pipeline runs and troubleshoot issues by specifying pipeline name and execution ID.
Instructions
Get logs for a pipeline execution
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipelineName | Yes | Name of the pipeline | |
| executionId | Yes | Execution ID |
Implementation Reference
- The main handler function for the 'get_pipeline_execution_logs' MCP tool. Fetches pipeline execution details from AWS CodePipeline via CodePipelineManager and formats the response as MCP content.
export async function getPipelineExecutionLogs( codePipelineManager: CodePipelineManager, input: { pipelineName: string; executionId: string; } ) { const { pipelineName, executionId } = input; const codepipeline = codePipelineManager.getCodePipeline(); const response = await codepipeline.getPipelineExecution({ pipelineName, pipelineExecutionId: executionId }).promise(); // Format the response for better readability // Extract and format the execution details const logs = { pipelineName: response.pipelineExecution?.pipelineName || pipelineName, pipelineVersion: response.pipelineExecution?.pipelineVersion || '1', pipelineExecution: { pipelineExecutionId: response.pipelineExecution?.pipelineExecutionId, status: response.pipelineExecution?.status, artifactRevisions: response.pipelineExecution?.artifactRevisions?.map((revision: AWS.CodePipeline.ArtifactRevision) => ({ name: revision.name, revisionId: revision.revisionId, revisionSummary: revision.revisionSummary, revisionUrl: revision.revisionUrl })) } }; return { content: [ { type: "text", text: JSON.stringify({ logs }, null, 2), }, ], }; } - The schema definition for the 'get_pipeline_execution_logs' tool, including name, description, and input schema validation.
export const getPipelineExecutionLogsSchema = { name: "get_pipeline_execution_logs", description: "Get logs for a pipeline execution", inputSchema: { type: "object", properties: { pipelineName: { type: "string", description: "Name of the pipeline" }, executionId: { type: "string", description: "Execution ID" } }, required: ["pipelineName", "executionId"], }, } as const;