gitlab_create_merge_request_note_internal
Add a comment to a GitLab merge request with the option to mark it as an internal note, visible only to project members, for secure and targeted communication.
Instructions
Add a comment to a merge request with option to make it an internal note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The content of the note/comment | |
| internal | No | If true, the note will be marked as an internal note visible only to project members | |
| 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 implementing the gitlab_create_merge_request_note_internal tool. It validates parameters, makes a POST request to the GitLab API to create a merge request note (optionally internal), and formats the response.export const createMergeRequestNoteInternal: ToolHandler = async (params, context) => { const { project_id, merge_request_iid, body, internal } = 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, internal: internal === true } ); return formatResponse(response.data); };
- src/utils/tools-data.ts:147-171 (schema)Input schema definition for the gitlab_create_merge_request_note_internal tool, specifying parameters and validation rules.name: 'gitlab_create_merge_request_note_internal', description: 'Add a comment to a merge request with option to make it an internal note', 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' }, internal: { type: 'boolean', description: 'If true, the note will be marked as an internal note visible only to project members' } }, required: ['project_id', 'merge_request_iid', 'body'] } },
- src/utils/tool-registry.ts:31-31 (registration)Registration of the tool handler in the central tool registry, mapping the tool name to the repoHandlers.createMergeRequestNoteInternal function.gitlab_create_merge_request_note_internal: repoHandlers.createMergeRequestNoteInternal,