Skip to main content
Glama

update_draft_note

Update an existing draft note on a GitLab merge request by editing its body or diff position; GitLab validates permissions and returns errors for invalid requests.

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
jmespathNoOptional JMESPath expression filtering the JSON result before return.
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.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Addedv2.1.18
  3. Removedv2.1.14
  4. Addedv2.1.11
  5. Removedv2.1.10
  6. 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"
      +]
  7. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

With only openWorldHint in annotations, the description carries the burden. It discloses that the tool mutates remote GitLab state, requires permissions, and that GitLab returns validation, conflict, permission, or rate-limit errors rather than silently succeeding. This is meaningful behavioral context beyond the sparse annotations.

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

Conciseness4/5

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

The description is a single paragraph with a clear front-loaded purpose. It is reasonably concise, but includes some redundancy (e.g., referencing pagination fields that don't exist) and could be tightened without losing information.

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

Completeness4/5

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

The tool has a complex position object, but the schema thoroughly documents it. The description covers mutation, permissions, and error behavior, which are the key non-schema contexts. It doesn't mention alternatives like publish or delete, but those are different operations. Given the schema's richness, the description is largely complete for calling the tool correctly.

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 coverage is 100%, so the baseline is 3. The description adds a note about providing numeric IDs or URL-encoded paths, but that duplicates the schema's own description for project_id. It also references pagination fields, but this tool has none. It does not add semantics for the complex position object beyond what the schema already explains.

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

Purpose5/5

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

The description opens with a clear verb and resource: 'Update an existing draft note.' It then explicitly differentiates from the create tool for new resources and from a note tool for discussion-only text, which distinguishes it from sibling tools like create_draft_note and create_note/update_merge_request_note.

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?

It gives explicit when-to-use guidance: 'Use this for an existing resource; choose the corresponding create tool for a new resource and a note tool for discussion-only text.' It also notes permission requirements and error behavior, but it doesn't reference other draft-note siblings like publish_draft_note or delete_draft_note. The guidance is clear enough for the primary alternatives.

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

Deploy Server

Other Tools