Skip to main content
Glama

gitlab_add_webhook

Adds a new webhook to a GitLab project, enabling event triggers like push, merge requests, or issues. Configure SSL verification and a secret token for secure payload validation.

Instructions

Add a new webhook to a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enable_ssl_verificationNoEnable SSL verification for the webhook
issues_eventsNoTrigger webhook for issues events
merge_requests_eventsNoTrigger webhook for merge request events
project_idYesThe ID or URL-encoded path of the project
push_eventsNoTrigger webhook for push events
tokenNoSecret token to validate received payloads
urlYesThe webhook URL

Implementation Reference

  • The main handler function that executes the gitlab_add_webhook tool logic. It validates parameters and delegates to context.integrationsManager.addWebhook.
    export const addWebhook: ToolHandler = async (params, context) => {
      const { project_id, ...options } = params.arguments || {};
      if (!project_id) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id is required');
      }
      
      if (!options.url) {
        throw new McpError(ErrorCode.InvalidParams, 'url is required for webhook');
      }
      
      const data = await context.integrationsManager.addWebhook(project_id as string | number, options as {
        url: string;
        name?: string;
        description?: string;
        token?: string;
        push_events?: boolean;
        push_events_branch_filter?: string;
        issues_events?: boolean;
        confidential_issues_events?: boolean;
        merge_requests_events?: boolean;
        tag_push_events?: boolean;
        note_events?: boolean;
        confidential_note_events?: boolean;
        job_events?: boolean;
        pipeline_events?: boolean;
        wiki_page_events?: boolean;
        deployment_events?: boolean;
        releases_events?: boolean;
        feature_flag_events?: boolean;
        enable_ssl_verification?: boolean;
        custom_webhook_template?: string;
        custom_headers?: Array<{key: string; value?: string}>;
      });
      return formatResponse(data);
    };
  • The input schema and description definition for the gitlab_add_webhook tool.
    {
      name: 'gitlab_add_webhook',
      description: 'Add a new webhook to a project',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          url: {
            type: 'string',
            description: 'The webhook URL'
          },
          token: {
            type: 'string',
            description: 'Secret token to validate received payloads'
          },
          push_events: {
            type: 'boolean',
            description: 'Trigger webhook for push events'
          },
          issues_events: {
            type: 'boolean',
            description: 'Trigger webhook for issues events'
          },
          merge_requests_events: {
            type: 'boolean',
            description: 'Trigger webhook for merge request events'
          },
          enable_ssl_verification: {
            type: 'boolean',
            description: 'Enable SSL verification for the webhook'
          }
        },
        required: ['project_id', 'url']
      }
    },
  • The registration of the gitlab_add_webhook tool mapping to its handler function integrationHandlers.addWebhook.
    gitlab_add_webhook: integrationHandlers.addWebhook,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Add a new webhook' implies a write operation, but it doesn't specify required permissions, whether the operation is idempotent, error conditions, or what happens on success (e.g., returns a webhook ID). This leaves significant gaps for a mutation tool.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable without unnecessary elaboration.

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 mutation tool with 7 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what the tool returns, error handling, authentication requirements, or how it differs from similar tools. The high schema coverage helps with parameters, but other critical context is missing.

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?

The input schema has 100% description coverage, so all parameters are documented in the schema itself. The description doesn't add any parameter-specific information beyond what's in the schema, nor does it explain relationships between parameters. This meets the baseline for high schema coverage.

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 'Add a new webhook to a project' clearly states the action (add) and resource (webhook to a project), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gitlab_update_webhook' or 'gitlab_delete_webhook' beyond the basic verb, which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'gitlab_update_webhook' or 'gitlab_delete_webhook'. It also lacks information about prerequisites (e.g., needing project access) or typical use cases, leaving the agent to infer usage from context alone.

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

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/rifqi96/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server