Skip to main content
Glama
by cuongdev

get_pipeline_execution_logs

Retrieve execution logs for a specific pipeline by providing the pipeline name and execution ID using AWS CodePipeline MCP Server.

Instructions

Get logs for a pipeline execution

Input Schema

NameRequiredDescriptionDefault
executionIdYesExecution ID
pipelineNameYesName of the pipeline

Input Schema (JSON Schema)

{ "properties": { "executionId": { "description": "Execution ID", "type": "string" }, "pipelineName": { "description": "Name of the pipeline", "type": "string" } }, "required": [ "pipelineName", "executionId" ], "type": "object" }

Implementation Reference

  • The handler function that implements the tool logic: fetches pipeline execution details using AWS CodePipeline SDK and returns formatted logs as text 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 defining the tool name, description, and input parameters (pipelineName and executionId).
    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;
  • src/index.ts:39-42 (registration)
    Import of the tool handler and schema.
    import { getPipelineExecutionLogs, getPipelineExecutionLogsSchema } from "./tools/get_pipeline_execution_logs.js";
  • src/index.ts:110-128 (registration)
    Registration of the tool schema in the MCP listTools request handler.
    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:173-178 (registration)
    Tool handler dispatch in the MCP callTool request handler switch statement.
    case "get_pipeline_execution_logs": { return await getPipelineExecutionLogs(codePipelineManager, input as { pipelineName: string; executionId: string; }); }

Other Tools

Related 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