Skip to main content
Glama
ffpy

GitLab MCP Code Review

by ffpy

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
NameRequiredDescriptionDefault
project_idYes
merge_request_iidYes
discussion_idYes
bodyYes

Implementation Reference

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

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