Skip to main content
Glama

GitLab MCP Code Review

by ffpy

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

NameRequiredDescriptionDefault
project_idYes
merge_request_iidYes
discussion_idYes
resolvedNo

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

  • 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()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ffpy/gitlab-mcp-code-review'

If you have feedback or need assistance with the MCP directory API, please join our Discord server