Skip to main content
Glama

gitlab_create_merge_request_note

Add comments to GitLab merge requests by specifying the project ID, merge request ID, and note content to facilitate code review and collaboration.

Instructions

Add a comment to a merge request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesThe content of the note/comment
merge_request_iidYesThe internal ID of the merge request
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • The main handler function that executes the gitlab_create_merge_request_note tool by posting a note to the GitLab merge request API endpoint.
    export const createMergeRequestNote: ToolHandler = async (params, context) => { const { project_id, merge_request_iid, body } = params.arguments || {}; if (!project_id || !merge_request_iid || !body) { throw new McpError(ErrorCode.InvalidParams, 'project_id, merge_request_iid, and body are required'); } const response = await context.axiosInstance.post( `/projects/${encodeURIComponent(String(project_id))}/merge_requests/${merge_request_iid}/notes`, { body } ); return formatResponse(response.data); };
  • Input schema definition for the gitlab_create_merge_request_note tool, specifying parameters and validation.
    { name: 'gitlab_create_merge_request_note', description: 'Add a comment to a merge request', 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' }, body: { type: 'string', description: 'The content of the note/comment' } }, required: ['project_id', 'merge_request_iid', 'body'] } },
  • Registration of the tool name 'gitlab_create_merge_request_note' mapping to the createMergeRequestNote handler.
    gitlab_create_merge_request_note: repoHandlers.createMergeRequestNote,

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