reply_to_merge_request_discussion
Post responses to merge request discussions on GitLab to address code review feedback and collaborate on changes.
Instructions
Reply to a merge request discussion.
Args:
project_id: The GitLab project ID or URL-encoded path
merge_request_iid: The merge request IID (project-specific ID)
discussion_id: The ID of the discussion to reply to
body: The reply text
Returns:
Dict containing the created note information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| merge_request_iid | Yes | ||
| discussion_id | Yes | ||
| body | Yes |
Implementation Reference
- server.py:406-426 (handler)The @mcp.tool()-decorated handler function that implements the logic to reply to a GitLab merge request discussion by creating a note on the specified discussion.@mcp.tool() def reply_to_merge_request_discussion(ctx: Context, project_id: str, merge_request_iid: str, discussion_id: str, body: str) -> Dict[str, Any]: """ Reply to a merge request discussion. Args: project_id: The GitLab project ID or URL-encoded path merge_request_iid: The merge request IID (project-specific ID) discussion_id: The ID of the discussion to reply to body: The reply text Returns: Dict containing the created note information """ gl = ctx.request_context.lifespan_context project = gl.projects.get(project_id) mr = project.mergerequests.get(merge_request_iid) discussion = mr.discussions.get(discussion_id) note = discussion.notes.create({'body': body}) return note.asdict()