Skip to main content
Glama

update_draft_note

Update an existing draft note on a GitLab merge request by specifying project, merge request, and draft note IDs. Revise draft content or position to refine feedback before publishing.

Instructions

Update an existing draft note. Use this for an existing resource; choose the corresponding create tool for a new resource and a note tool for discussion-only text. 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
bodyNoThe content of the draft note
positionNoPosition when creating a diff note
project_idYesProject ID or complete URL-encoded path to project
draft_note_idYesThe ID of the draft note
merge_request_iidYesThe IID of a merge request
resolve_discussionNoWhether to resolve the discussion when publishing

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. Changed8 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • 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"
      +]
    • addedInput schema / required
      Added value: +[
      +  "project_id",
      +  "merge_request_iid",
      +  "draft_note_id"
      +]
  6. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

The description states the side effect ('Changes remote GitLab state') and error semantics ('GitLab returns validation, permission, conflict, or rate-limit errors instead of silently applying an invalid request'), which is exactly the kind of behavioral information that helps an agent anticipate side effects and failure modes beyond a basic 'updates a draft' description. It also specifies input acceptance behavior for `project_id` (accepts numeric ID or URL-encoded path). However, it doesn't address idempotency, whether the action is repeatable, or whether the draft is published atomically, leaving some behavioral questions unanswered.

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

Conciseness2/5

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

The first two sentences are concise, but the rest of the description devolves into a wall of text with critical warnings (line_code, line numbers) that should be reformatted into a list or moved entirely into the schema. The description is long and run-on, with the most important implementation details (critical for line_code) buried in the middle of a paragraph. It ultimately reduces clarity due to lack of concision.

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 request/response aspects well, covering side effects, error semantics, and input constraints, but it does not address the response contract or pagination, and gives no hints about what the `draft_note` or the API should return. This is a meaningful gap, but the absence of an output schema is addressed, and the description adequately covers input correctness rather than response interpretation.

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

Parameters5/5

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

The schema is 100% covered, and the description correctly defers to it ('use required identifiers and pagination fields exactly as documented'), making the schema the authoritative source. The description adds minimal duplicate information about requiring the permission or the position of the request in the URL, which is a good signpost to the schema's own authoritative details.

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 tool's purpose in the first sentence with a focus on 'existing' vs. 'new' and 'discussion-only text'. This clearly distinguishes it from the create and note variants, naming the sibling tools explicitly to avoid confusion. The specific language 'use a note tool for discussion-only text' precisely targets the correct sibling for non-draft discussions.

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 explicitly differentiates when to use this tool versus its two closest siblings (create for new, note for discussion-only) in the very first sentence, giving the model clear selection criteria without needing to parse any sibling names. It also warns about the API returning validation/rate-limit errors instead of silently failing, which helps the model anticipate failure modes and react accordingly. This is strong guidance for the primary decision an agent must make (when to invoke this vs. alternatives), though it omits the broader draft lifecycle (e.g., when to use drafts vs. published notes).

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