Skip to main content
Glama

gitlab_update_merge_request

Modify the title and description of a GitLab merge request using the internal ID and project identifier. Simplifies updating merge request details within GitLab MCP Server.

Instructions

Update a merge request title and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoThe description of the merge request
merge_request_iidYesThe internal ID of the merge request
project_idYesThe ID or URL-encoded path of the project
titleNoThe title of the merge request

Implementation Reference

  • The main handler function that implements the logic for updating a GitLab merge request's title and/or description by making a PUT request to the GitLab API.
    export const updateMergeRequest: ToolHandler = async (params, context) => {
      const { project_id, merge_request_iid, title, description } = params.arguments || {};
      if (!project_id || !merge_request_iid) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id and merge_request_iid are required');
      }
      
      if (!title && !description) {
        throw new McpError(ErrorCode.InvalidParams, 'At least one of title or description is required');
      }
      
      const response = await context.axiosInstance.put(
        `/projects/${encodeURIComponent(String(project_id))}/merge_requests/${merge_request_iid}`,
        { title, description }
      );
      return formatResponse(response.data);
    };
  • The tool schema definition specifying the input parameters, descriptions, and requirements for the gitlab_update_merge_request tool.
    {
      name: 'gitlab_update_merge_request',
      description: 'Update a merge request title and description',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          merge_request_iid: {
            type: 'number',
            description: 'The internal ID of the merge request'
          },
          title: {
            type: 'string',
            description: 'The title of the merge request'
          },
          description: {
            type: 'string',
            description: 'The description of the merge request'
          }
        },
        required: ['project_id', 'merge_request_iid']
      }
    },
  • The registration entry in the tool registry that maps the tool name 'gitlab_update_merge_request' to its handler function repoHandlers.updateMergeRequest.
    gitlab_update_merge_request: repoHandlers.updateMergeRequest,

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