Skip to main content
Glama

GitLab MCP Code Review

by ffpy

reply_to_merge_request_discussion

Respond to specific discussions in GitLab merge requests by adding comments that address code review feedback or questions from team members.

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

NameRequiredDescriptionDefault
project_idYes
merge_request_iidYes
discussion_idYes
bodyYes

Input Schema (JSON Schema)

{ "properties": { "body": { "title": "Body", "type": "string" }, "discussion_id": { "title": "Discussion Id", "type": "string" }, "merge_request_iid": { "title": "Merge Request Iid", "type": "string" }, "project_id": { "title": "Project Id", "type": "string" } }, "required": [ "project_id", "merge_request_iid", "discussion_id", "body" ], "type": "object" }

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the logic to reply to a merge request discussion by creating a note via GitLab API.
    @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