create_mr_note
Add a comment to a GitLab merge request to provide feedback, ask questions, or document decisions during code review.
Instructions
Add a new top-level comment to a merge request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| merge_request_iid | Yes | Merge request internal ID | |
| body | Yes | The content of the comment (supports Markdown) |
Implementation Reference
- src/handlers/merge-requests.ts:403-423 (handler)The main handler function that implements the create_mr_note tool by posting a new note to the GitLab merge request API endpoint and returning the response.async createMRNote(args: CreateMRNoteParams) { const requestData = { body: args.body, }; const data = await this.client.post( `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${ args.merge_request_iid }/notes`, requestData ); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/merge-requests.ts:379-398 (registration)MCP tool registration defining the name, description, and input schema for the create_mr_note tool.name: 'create_mr_note', description: 'Add a new top-level comment to a merge request', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, merge_request_iid: { type: 'number', description: 'Merge request internal ID', }, body: { type: 'string', description: 'The content of the comment (supports Markdown)', }, }, required: ['project_id', 'merge_request_iid', 'body'], },
- src/types.ts:485-489 (schema)TypeScript interface defining the input parameters for the create_mr_note tool.export interface CreateMRNoteParams { project_id: string; merge_request_iid: number; body: string; }
- src/server.ts:215-218 (registration)Server-side dispatch that routes calls to the create_mr_note tool to the appropriate handler method.case "create_mr_note": return await this.mergeRequestHandlers.createMRNote( args as unknown as CreateMRNoteParams );