resolve_merge_request_discussion
Resolve or unresolve discussions in GitLab merge requests to track and manage code review feedback completion.
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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| merge_request_iid | Yes | ||
| discussion_id | Yes | ||
| resolved | No |
Input Schema (JSON Schema)
{
"properties": {
"discussion_id": {
"title": "Discussion Id",
"type": "string"
},
"merge_request_iid": {
"title": "Merge Request Iid",
"type": "string"
},
"project_id": {
"title": "Project Id",
"type": "string"
},
"resolved": {
"default": true,
"title": "Resolved",
"type": "boolean"
}
},
"required": [
"project_id",
"merge_request_iid",
"discussion_id"
],
"type": "object"
}
Implementation Reference
- server.py:281-302 (handler)The handler function for the 'resolve_merge_request_discussion' tool. It fetches the merge request discussion using the GitLab API and sets its resolved state to the provided boolean value, then saves and returns the updated discussion.@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()