Skip to main content
Glama

gitlab_create_merge_request_note

Add comments to GitLab merge requests by specifying the project ID, merge request ID, and note content to facilitate code review and collaboration.

Instructions

Add a comment to a merge request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesThe content of the note/comment
merge_request_iidYesThe internal ID of the merge request
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • The main handler function that executes the gitlab_create_merge_request_note tool by posting a note to the GitLab merge request API endpoint.
    export const createMergeRequestNote: ToolHandler = async (params, context) => {
      const { project_id, merge_request_iid, body } = params.arguments || {};
      if (!project_id || !merge_request_iid || !body) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id, merge_request_iid, and body are required');
      }
      
      const response = await context.axiosInstance.post(
        `/projects/${encodeURIComponent(String(project_id))}/merge_requests/${merge_request_iid}/notes`,
        { body }
      );
      return formatResponse(response.data);
    };
  • Input schema definition for the gitlab_create_merge_request_note tool, specifying parameters and validation.
    {
      name: 'gitlab_create_merge_request_note',
      description: 'Add a comment to a merge request',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          merge_request_iid: {
            type: 'number',
            description: 'The internal ID of the merge request'
          },
          body: {
            type: 'string',
            description: 'The content of the note/comment'
          }
        },
        required: ['project_id', 'merge_request_iid', 'body']
      }
    },
  • Registration of the tool name 'gitlab_create_merge_request_note' mapping to the createMergeRequestNote handler.
    gitlab_create_merge_request_note: repoHandlers.createMergeRequestNote,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it 'adds' a comment (implying a write operation) but doesn't disclose authentication requirements, rate limits, error conditions, or whether the comment is editable/deletable. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after adding the comment (e.g., success response, error cases), nor does it cover behavioral aspects like permissions or side effects. The high schema coverage helps with inputs, but overall context is lacking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., no format examples for project_id or merge_request_iid). This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a comment') and target resource ('to a merge request'), which is specific and unambiguous. However, it doesn't differentiate from the sibling tool 'gitlab_create_merge_request_note_internal', leaving some ambiguity about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing appropriate permissions), nor does it distinguish it from the similar-sounding sibling tool 'gitlab_create_merge_request_note_internal', leaving the agent to guess about usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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

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