resolve_merge_request_discussion
Resolve or unresolve discussions in GitLab merge requests to manage code review feedback and track issue resolution status.
Instructions
Resolve or unresolve 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
resolved: True to resolve, False to unresolve
Returns:
Dict containing the updated discussion information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| merge_request_iid | Yes | ||
| discussion_id | Yes | ||
| resolved | No |
Implementation Reference
- server.py:429-451 (handler)The @mcp.tool() decorated handler function that implements the resolve_merge_request_discussion tool. It fetches the GitLab project and merge request, gets the specific discussion, sets its resolved state, saves it, and returns the updated discussion as a dictionary.@mcp.tool() def resolve_merge_request_discussion(ctx: Context, project_id: str, merge_request_iid: str, discussion_id: str, resolved: bool = True) -> Dict[str, Any]: """ Resolve or unresolve 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 resolved: True to resolve, False to unresolve Returns: Dict containing the updated discussion 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) discussion.resolved = resolved discussion.save() return discussion.asdict()