Skip to main content
Glama

create_draft_note

Post a draft note to a GitLab merge request to save review feedback before publishing. Attach it to specific diff lines or discussions to keep comments in context.

Instructions

Create a draft note for a merge request. Use this for a new resource or action; choose the corresponding update or edit tool when the resource already exists. It changes remote GitLab state and requires the necessary project or group permission; GitLab returns validation, conflict, permission, or rate-limit errors instead of silently applying an invalid request. When project_id or group_id is accepted, provide the numeric ID or complete URL-encoded path described by the schema; use required identifiers and pagination fields exactly as documented.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesThe content of the draft note
positionNoPosition when creating a diff note
project_idYesProject ID or complete URL-encoded path to project
merge_request_iidYesThe IID of a merge request
resolve_discussionNoWhether to resolve the discussion when publishing
in_reply_to_discussion_idNoThe ID of a discussion the draft note replies to

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv2.1.18
  2. Removedv2.1.14
  3. Addedv2.1.11
  4. Removedv2.1.10
  5. Changed9 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / in_reply_to_discussion_id
      Added value: +{
      +  "description": "The ID of a discussion the draft note replies to",
      +  "type": "string"
      +}
    • removedInput schema / properties / position / additionalProperties
      Removed value: -false
    • changedInput schema / properties / position / properties / height / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedInput schema / properties / position / properties / line_range / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "description": "Line range for multiline comments on GitLab merge request diffs. VALIDATION RULES: 1) line_code is critical for GitLab API success, 2) start/end must have consistent types, 3) line numbers must form valid range, 4) get line_code from GitLab diff API, never generate manually.",
      -    "properties": {
      -      "end": {
      -        "additionalProperties": false,
      -        "description": "End line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither. Range must be valid (end >= start).",
      -        "properties": {
      -          "line_code": {
      -            "description": "CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_12_17'. Must be from same file as start.line_code.",
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "new_line": {
      -            "description": "Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines. MUST be >= start.new_line if both specified.",
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "old_line": {
      -            "description": "Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines. MUST be >= start.old_line if both specified.",
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "type": {
      -            "anyOf": [
      -              {
      -                "enum": [
      -                  "new",
      -                  "old",
      -                  "expanded",
      -                  "logic",
      -                  "style"
      -                ],
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ],
      -            "description": "Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. SHOULD MATCH start.type for consistent ranges (don't mix old/new types)."
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "start": {
      -        "additionalProperties": false,
      -        "description": "Start line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither.",
      -        "properties": {
      -          "line_code": {
      -            "description": "CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_10_15'. Get this from GitLab diff API response, never fabricate.",
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "new_line": {
      -            "description": "Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines.",
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "old_line": {
      -            "description": "Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines.",
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "type": {
      -            "anyOf": [
      -              {
      -                "enum": [
      -                  "new",
      -                  "old",
      -                  "expanded",
      -                  "logic",
      -                  "style"
      -                ],
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ],
      -            "description": "Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. MUST match the line_code format and old_line/new_line values."
      -          }
      -        },
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "start",
      -      "end"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Line range for multiline comments on GitLab merge request diffs. VALIDATION RULES: 1) line_code is critical for GitLab API success, 2) start/end must have consistent types, 3) line numbers must form valid range, 4) get line_code from GitLab diff API, never generate manually.",
      +    "properties": {
      +      "end": {
      +        "description": "End line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither. Range must be valid (end >= start).",
      +        "properties": {
      +          "line_code": {
      +            "description": "CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_12_17'. Must be from same file as start.line_code.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "new_line": {
      +            "description": "Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines. MUST be >= start.new_line if both specified.",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "old_line": {
      +            "description": "Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines. MUST be >= start.old_line if both specified.",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "type": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "new",
      +                  "old",
      +                  "expanded",
      +                  "logic",
      +                  "style"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "description": "Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. SHOULD MATCH start.type for consistent ranges (don't mix old/new types)."
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "start": {
      +        "description": "Start line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither.",
      +        "properties": {
      +          "line_code": {
      +            "description": "CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_10_15'. Get this from GitLab diff API response, never fabricate.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "new_line": {
      +            "description": "Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines.",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "old_line": {
      +            "description": "Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines.",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "type": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "new",
      +                  "old",
      +                  "expanded",
      +                  "logic",
      +                  "style"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "description": "Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. MUST match the line_code format and old_line/new_line values."
      +          }
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "start",
      +      "end"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / position / properties / width / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedInput schema / properties / position / properties / x / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedInput schema / properties / position / properties / y / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "body"
      -]New value: +[
      +  "body",
      +  "project_id",
      +  "merge_request_iid"
      +]
  6. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

The annotations only include openWorldHint, so the description carries most of the behavioral disclosure burden. It clearly states that this tool changes remote GitLab state, requires project or group permissions, and surfaces validation, conflict, permission, or rate-limit errors instead of silently applying invalid requests. This is useful beyond the structured annotation data, though it doesn't clarify the draft note's unpublished/pending state and its relationship to publishing workflows.

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

Conciseness3/5

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

The description is relatively short and contains only a few sentences, but the final sentence is verbose and introduces references to 'group_id' and 'pagination fields' that are not immediately relevant to this schema. It front-loads the main purpose well, but some content could be tightened for clarity.

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

Completeness3/5

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

The description covers permissions, state mutation, and common error behavior, which is helpful given that no output schema exists. However, for a complex tool with a nested position object, it does not explain the conceptual difference between a draft note and a published merge request note, nor how this tool fits with publish_draft_note and list_draft_notes. It is sufficient for a basic create attempt but incomplete for an agent deciding whether to use this or a sibling tool.

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?

The input schema covers 100% of parameters and already provides detailed descriptions, including strong guidance for nested fields like line_range and line_code. The description only adds a generic instruction about providing numeric IDs or URL-encoded paths, which mostly repeats the schema's project_id description. It does not add meaningful semantics for the other parameters.

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 that this tool creates a draft note for a merge request and explicitly contrasts it with update or edit tools for existing resources. However, it does not differentiate from sibling creation tools like create_merge_request_note or create_merge_request_discussion_note, relying mainly on the word 'draft' in the tool name.

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

Usage Guidelines4/5

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

The description provides a direct usage rule: use this for new resources/actions and switch to an update or edit tool when the resource already exists. It also notes that the operation changes remote GitLab state and requires permissions, but it does not give guidance on when a regular merge request note or a published note would be more appropriate than a draft.

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

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

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