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
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | The description of the merge request | |
| merge_request_iid | Yes | The internal ID of the merge request | |
| project_id | Yes | The ID or URL-encoded path of the project | |
| title | No | The title of the merge request |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"description": "The description of the merge request",
"type": "string"
},
"merge_request_iid": {
"description": "The internal ID of the merge request",
"type": "number"
},
"project_id": {
"description": "The ID or URL-encoded path of the project",
"type": "string"
},
"title": {
"description": "The title of the merge request",
"type": "string"
}
},
"required": [
"project_id",
"merge_request_iid"
],
"type": "object"
}
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); };
- src/utils/tools-data.ts:172-197 (schema)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'] } },
- src/utils/tool-registry.ts:32-32 (registration)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,