reply_to_mr_discussion
Add responses to merge request discussion threads to provide feedback, answer questions, or resolve comments during code review.
Instructions
Reply to an existing discussion thread on 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 | |
| discussion_id | Yes | The ID of the discussion to reply to | |
| body | Yes | The content of the reply (supports Markdown) |
Implementation Reference
- src/handlers/merge-requests.ts:465-485 (handler)The core handler function that executes the tool by posting a reply note to the specified GitLab merge request discussion via API.async replyToMRDiscussion(args: ReplyToMRDiscussionParams) { const requestData = { body: args.body, }; const data = await this.client.post( `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${ args.merge_request_iid }/discussions/${args.discussion_id}/notes`, requestData ); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/types.ts:507-512 (schema)TypeScript interface defining the input parameters for the replyToMRDiscussion handler.export interface ReplyToMRDiscussionParams { project_id: string; merge_request_iid: number; discussion_id: string; body: string; }
- src/tools/merge-requests.ts:469-494 (registration)Tool registration including name, description, and input schema for MCP protocol.{ name: 'reply_to_mr_discussion', description: 'Reply to an existing discussion thread on 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', }, discussion_id: { type: 'string', description: 'The ID of the discussion to reply to', }, body: { type: 'string', description: 'The content of the reply (supports Markdown)', }, }, required: ['project_id', 'merge_request_iid', 'discussion_id', 'body'], }, },
- src/server.ts:223-226 (registration)Dispatch logic in server that routes the tool call to the merge request handler.case "reply_to_mr_discussion": return await this.mergeRequestHandlers.replyToMRDiscussion( args as unknown as ReplyToMRDiscussionParams );