Skip to main content
Glama
cuongdev

AWS CodePipeline MCP Server

by cuongdev

get_pipeline_details

Retrieve the complete configuration and definition of an AWS CodePipeline to understand its structure, stages, and actions for troubleshooting or analysis.

Instructions

Get the full definition of a specific pipeline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline

Implementation Reference

  • The main handler function that fetches and formats the details of a specified AWS CodePipeline pipeline using the AWS SDK.
    export async function getPipelineDetails(
      codePipelineManager: CodePipelineManager, 
      input: { pipelineName: string }
    ) {
      const { pipelineName } = input;
      const codepipeline = codePipelineManager.getCodePipeline();
      
      const response = await codepipeline.getPipeline({ name: pipelineName }).promise();
      
      // Format the pipeline details for better readability
      const pipelineDetails = {
        pipeline: {
          name: response.pipeline?.name || '',
          roleArn: response.pipeline?.roleArn || '',
          artifactStore: response.pipeline?.artifactStore,
          stages: response.pipeline?.stages?.map(stage => ({
            name: stage.name,
            actions: stage.actions?.map(action => ({
              name: action.name,
              actionTypeId: action.actionTypeId,
              runOrder: action.runOrder,
              configuration: action.configuration,
              outputArtifacts: action.outputArtifacts,
              inputArtifacts: action.inputArtifacts,
              region: action.region,
              namespace: action.namespace
            }))
          })),
          version: response.pipeline?.version || 0,
          metadata: {
            created: response.metadata?.created?.toISOString() || '',
            updated: response.metadata?.updated?.toISOString() || '',
            pipelineArn: response.metadata?.pipelineArn || ''
          }
        }
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(pipelineDetails, null, 2),
          },
        ],
      };
    }
  • Schema definition for the get_pipeline_details tool, including name, description, and input validation structure.
    export const getPipelineDetailsSchema = {
      name: "get_pipeline_details",
      description: "Get the full definition of a specific pipeline",
      inputSchema: {
        type: "object",
        properties: {
          pipelineName: { 
            type: "string",
            description: "Name of the pipeline"
          }
        },
        required: ["pipelineName"],
      },
    } as const;
  • src/index.ts:189-193 (registration)
    Dispatch logic in the MCP server's CallToolRequestHandler switch statement that routes tool calls to the getPipelineDetails handler.
    case "get_pipeline_details": {
      return await getPipelineDetails(codePipelineManager, input as {
        pipelineName: string;
      });
    }
  • src/index.ts:121-122 (registration)
    Registration of the tool schema in the list of available tools returned by the ListToolsRequestHandler.
    // Add new tool schemas
    getPipelineDetailsSchema,
  • src/index.ts:50-53 (registration)
    Import statement in the main server file that loads the tool handler and schema.
    import {
      getPipelineDetails,
      getPipelineDetailsSchema
    } from "./tools/get_pipeline_details.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