Skip to main content
Glama

gitlab_merge_merge_request

Merge an approved GitLab merge request after meeting prerequisites like approvals and CI passing. Supports options for squash commits, branch deletion, and auto-merge on pipeline success.

Instructions

Merge an approved merge request Returns: Merge result with commit SHA Use when: MR is approved and ready Options: Squash, delete branch, auto-merge

Prerequisites:

  • No conflicts

  • Approvals met

  • CI passing (if required)

Related tools:

  • gitlab_get_merge_request: Check merge status

  • gitlab_approve_merge_request: Add approval

  • gitlab_rebase_merge_request: Fix conflicts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
mr_iidYesMerge request number (IID - Internal ID) Type: integer Format: Project-specific MR number (without !) Required: Yes Examples: - 456 (for MR !456) - 7890 (for MR !7890) How to find: Look at MR URL or title - URL: https://gitlab.com/group/project/-/merge_requests/456 → use 456 - Title: "Add new feature (!456)" → use 456 Note: This is NOT the global MR ID
merge_when_pipeline_succeedsNoAuto-merge on pipeline success Type: boolean Default: false Options: - true: Merge automatically when CI passes - false: Manual merge required Requirements: Pipeline must be running Use case: Ensure CI passes before merging
should_remove_source_branchNoDelete source branch after merge Type: boolean Default: false Options: - true: Delete branch after successful merge - false: Keep branch after merge Requirements: User must have permission to delete Use case: Automatic cleanup of feature branches
merge_commit_messageNoCustom merge commit message Type: string Optional: Yes Variables supported: - %{title}: MR title - %{description}: MR description - %{reference}: MR reference (!123) Example: 'Merge %{title} (%{reference})' Default: GitLab's default format
squash_commit_messageNoCustom squash commit message Type: string Optional: Yes Variables supported: Same as merge_commit_message Example: '%{title} (#%{reference})' Use case: Customize squashed commit message
squashNoSquash commits on merge Type: boolean Default: Follows project settings Options: - true: Combine all commits into one - false: Keep all commits - null: Use project default Use case: Clean commit history

Tool Definition Quality

Score is being calculated. Check back soon.

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

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