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
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The content of the note/comment | |
| merge_request_iid | Yes | The internal ID of the merge request | |
| project_id | Yes | The 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); };
- src/utils/tools-data.ts:124-145 (schema)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'] } },
- src/utils/tool-registry.ts:30-30 (registration)Registration of the tool name 'gitlab_create_merge_request_note' mapping to the createMergeRequestNote handler.gitlab_create_merge_request_note: repoHandlers.createMergeRequestNote,