Skip to main content
Glama
Alosies

GitLab MCP Server

by Alosies

create_mr_discussion_note

Add a note to an existing merge request discussion thread to provide feedback, ask questions, or continue conversations about code changes.

Instructions

Add a new note to an existing merge request discussion thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or path
merge_request_iidYesMerge request internal ID
discussion_idYesThe ID of the discussion to add the note to
bodyYesThe content of the note (supports Markdown)

Implementation Reference

  • The main handler function that executes the tool logic by posting a new note to the specified GitLab MR discussion endpoint.
    async createMRDiscussionNote(args: CreateMRDiscussionNoteParams) {
      const data = await this.client.post(
        `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${
          args.merge_request_iid
        }/discussions/${args.discussion_id}/notes`,
        { body: args.body }
      );
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • TypeScript interface defining the input parameters for the create_mr_discussion_note tool.
    export interface CreateMRDiscussionNoteParams {
      project_id: string;
      merge_request_iid: number;
      discussion_id: string;
      body: string;
    }
  • Tool registration in the mergeRequestTools array, including name, description, and inputSchema.
      name: 'create_mr_discussion_note',
      description: 'Add a new note to an existing merge request discussion thread',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'Project ID or path',
          },
          merge_request_iid: {
            type: 'number',
            description: 'Merge request internal ID',
          },
          discussion_id: {
            type: 'string',
            description: 'The ID of the discussion to add the note to',
          },
          body: {
            type: 'string',
            description: 'The content of the note (supports Markdown)',
          },
        },
        required: ['project_id', 'merge_request_iid', 'discussion_id', 'body'],
      },
    },
  • src/server.ts:239-242 (registration)
    Dispatch case in the server tool handler switch statement that routes calls to the merge request handler.
    case "create_mr_discussion_note":
      return await this.mergeRequestHandlers.createMRDiscussionNote(
        args as unknown as CreateMRDiscussionNoteParams
      );

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

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