Skip to main content
Glama

create_merge_request_thread

Add discussion threads to GitLab merge requests for code review, feedback, and collaboration on specific changes.

Instructions

Create a new thread on a merge request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or complete URL-encoded path to project
merge_request_iidYesThe IID of a merge request
bodyYesThe content of the thread
positionNoPosition when creating a diff note
created_atNoDate the thread was created at (ISO 8601 format)

Implementation Reference

  • Zod input schema for creating a new merge request thread/discussion, matching the tool 'create_merge_request_thread' parameters: project_id (inherited), merge_request_iid, body, optional position and created_at.
    export const CreateMergeRequestThreadSchema = ProjectParamsSchema.extend({ merge_request_iid: z.number().describe("The IID of a merge request"), body: z.string().describe("The content of the thread"), position: MergeRequestThreadPositionSchema.optional().describe( "Position when creating a diff note" ), created_at: z.string().optional().describe("Date the thread was created at (ISO 8601 format)"), });
  • Supporting schema for position parameter in diff notes when creating merge request threads.
    export const MergeRequestThreadPositionSchema = z.object({ base_sha: z.string().describe("Base commit SHA in the source branch"), head_sha: z.string().describe("SHA referencing HEAD of the source branch"), start_sha: z.string().describe("SHA referencing the start commit of the source branch"), position_type: z.enum(["text", "image", "file"]).describe("Type of position reference"), new_path: z.string().optional().describe("File path after change"), old_path: z.string().optional().describe("File path before change"), new_line: z.number().nullable().optional().describe("Line number after change"), old_line: z.number().nullable().optional().describe("Line number before change"), width: z.number().optional().describe("Width of the image (for image diffs)"), height: z.number().optional().describe("Height of the image (for image diffs)"), x: z.number().optional().describe("X coordinate on the image (for image diffs)"), y: z.number().optional().describe("Y coordinate on the image (for image diffs)"), });
  • Type export for the thread creation options, confirming schema usage in tool definition.
    export type CreateMergeRequestThreadOptions = z.infer<typeof CreateMergeRequestThreadSchema>;

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/harshmaur/gitlab-mcp'

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