Skip to main content
Glama
cuongdev

AWS CodePipeline MCP Server

by cuongdev

create_pipeline_webhook

Create a webhook for an AWS CodePipeline to enable automatic pipeline triggering based on external events, with configurable authentication and event filters.

Instructions

Create a webhook for a pipeline to enable automatic triggering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline
webhookNameYesName for the webhook
targetActionYesThe name of the action in the pipeline that processes the webhook
authenticationYesAuthentication method for the webhook
authenticationConfigurationNoAuthentication configuration based on the authentication type
filtersNoEvent filters for the webhook

Implementation Reference

  • The main handler function that implements the create_pipeline_webhook tool logic, creating and registering a webhook for an AWS CodePipeline using the AWS SDK.
    export async function createPipelineWebhook(
      codePipelineManager: CodePipelineManager, 
      input: {
        pipelineName: string;
        webhookName: string;
        targetAction: string;
        authentication: string;
        authenticationConfiguration?: {
          SecretToken?: string;
          AllowedIpRange?: string;
        };
        filters?: Array<{
          jsonPath: string;
          matchEquals?: string;
        }>;
      }
    ) {
      const { 
        pipelineName, 
        webhookName, 
        targetAction, 
        authentication, 
        authenticationConfiguration = {}, 
        filters = [] 
      } = input;
      
      const codepipeline = codePipelineManager.getCodePipeline();
      
      // Create the webhook
      const response = await codepipeline.putWebhook({
        webhook: {
          name: webhookName,
          targetPipeline: pipelineName,
          targetAction: targetAction,
          filters: filters.map(filter => ({
            jsonPath: filter.jsonPath,
            matchEquals: filter.matchEquals
          })),
          authentication,
          authenticationConfiguration
        }
      }).promise();
      
      // Register the webhook
      await codepipeline.registerWebhookWithThirdParty({
        webhookName
      }).promise();
    
      // Extract webhook details safely
      const webhookDetails = {
        name: webhookName,
        url: response.webhook ? String(response.webhook.url) : undefined,
        targetPipeline: pipelineName,
        targetAction: targetAction
      };
      
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ 
              message: "Pipeline webhook created and registered successfully",
              webhookDetails
            }, null, 2),
          },
        ],
      };
    }
  • The input schema and metadata definition for the create_pipeline_webhook tool, specifying parameters like pipelineName, webhookName, targetAction, authentication, etc.
    export const createPipelineWebhookSchema = {
      name: "create_pipeline_webhook",
      description: "Create a webhook for a pipeline to enable automatic triggering",
      inputSchema: {
        type: "object",
        properties: {
          pipelineName: { 
            type: "string",
            description: "Name of the pipeline"
          },
          webhookName: { 
            type: "string",
            description: "Name for the webhook"
          },
          targetAction: { 
            type: "string",
            description: "The name of the action in the pipeline that processes the webhook"
          },
          authentication: { 
            type: "string",
            description: "Authentication method for the webhook",
            enum: ["GITHUB_HMAC", "IP", "UNAUTHENTICATED"]
          },
          authenticationConfiguration: {
            type: "object",
            description: "Authentication configuration based on the authentication type",
            properties: {
              SecretToken: {
                type: "string",
                description: "Secret token for GITHUB_HMAC authentication"
              },
              AllowedIpRange: {
                type: "string",
                description: "Allowed IP range for IP authentication"
              }
            }
          },
          filters: {
            type: "array",
            description: "Event filters for the webhook",
            items: {
              type: "object",
              properties: {
                jsonPath: {
                  type: "string",
                  description: "JSON path to filter events"
                },
                matchEquals: {
                  type: "string",
                  description: "Value to match in the JSON path"
                }
              },
              required: ["jsonPath"]
            }
          }
        },
        required: ["pipelineName", "webhookName", "targetAction", "authentication"],
      },
    } as const;
  • src/index.ts:202-217 (registration)
    Registration of the create_pipeline_webhook tool in the MCP server's CallToolRequestHandler switch statement, dispatching calls to the handler function.
    case "create_pipeline_webhook": {
      return await createPipelineWebhook(codePipelineManager, input as {
        pipelineName: string;
        webhookName: string;
        targetAction: string;
        authentication: string;
        authenticationConfiguration?: {
          SecretToken?: string;
          AllowedIpRange?: string;
        };
        filters?: Array<{
          jsonPath: string;
          matchEquals?: string;
        }>;
      });
    }
  • src/index.ts:61-63 (registration)
    Import statement for the create_pipeline_webhook handler and schema.
      createPipelineWebhook,
      createPipelineWebhookSchema
    } from "./tools/create_pipeline_webhook.js";
  • src/index.ts:124-124 (registration)
    Inclusion of the createPipelineWebhookSchema in the list of tools returned by ListToolsRequestHandler.
    createPipelineWebhookSchema,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but provides minimal behavioral insight. It states the tool creates a webhook but doesn't disclose critical traits: whether this is a mutating operation (implied but not confirmed), authentication requirements, rate limits, error conditions, or what happens on success (e.g., returns webhook ID). The phrase 'enable automatic triggering' hints at behavior but lacks specifics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place: 'Create' (action), 'webhook' (resource), 'for a pipeline' (context), and 'to enable automatic triggering' (benefit). No redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex mutation tool with 6 parameters (including nested objects), no annotations, and no output schema, the description is insufficient. It doesn't cover behavioral aspects (permissions, side effects), output format, error handling, or usage context. The schema handles parameters well, but the description fails to compensate for missing annotation and output information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no parameter-specific information beyond what's in the schema (e.g., doesn't explain relationships between 'authentication' and 'authenticationConfiguration', or how 'filters' work). Baseline 3 is appropriate as the schema handles parameter semantics adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a webhook') and the target resource ('for a pipeline'), with the purpose 'to enable automatic triggering' providing functional context. It distinguishes from siblings like 'trigger_pipeline' (manual) or 'get_pipeline_details' (read-only), but doesn't explicitly contrast with other webhook-related tools (none present).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites (e.g., pipeline must exist), when webhooks are appropriate versus manual triggers, or how it differs from 'trigger_pipeline' (which appears to be manual). Usage is implied by the description but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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