Skip to content

Conversation

@croatialu
Copy link

@croatialu croatialu commented Oct 14, 2025

Overview

This change adds full CRUD support for both Merge Request (MR) Notes and Discussion Notes, plus the ability to resolve/unresolve MR discussion threads. It also clarifies naming to distinguish MR-level notes from discussion-thread notes.

Key Changes

  • Expanded schema imports to cover new MR note and discussion note operations.
  • Added tools and request handlers for:
    • Resolving/unresolving MR discussion threads.
    • Creating/updating/deleting discussion notes within threads.
    • Creating/updating/deleting MR-level notes, plus fetching a single note and listing notes.
  • Minor formatting improvement for the denied tools regex line.

New/Updated Schemas

  • Added: CreateMergeRequestDiscussionNoteSchema, DeleteMergeRequestNoteSchema, UpdateMergeRequestDiscussionNoteSchema, GetMergeRequestNotesSchema, GetMergeRequestNoteSchema, DeleteMergeRequestDiscussionNoteSchema, ResolveMergeRequestThreadSchema.

New Tools

  • Thread resolution:
    • resolve_merge_request_thread
  • Discussion notes (thread-attached):
    • create_merge_request_discussion_note
    • update_merge_request_discussion_note
    • delete_merge_request_discussion_note
  • MR-level notes:
    • create_merge_request_note
    • update_merge_request_note
    • delete_merge_request_note
    • get_merge_request_note
    • get_merge_request_notes

New/Renamed Functions

  • New:
    • deleteMergeRequestDiscussionNote
    • createMergeRequestNote
    • deleteMergeRequestNote
    • getMergeRequestNote
    • getMergeRequestNotes
    • updateMergeRequestNote (MR-level)
    • resolveMergeRequestThread
  • Renamed:
    • updateMergeRequestNoteupdateMergeRequestDiscussionNote (discussion note)
    • createMergeRequestNote (discussion) → createMergeRequestDiscussionNote

Request Routing Updates

  • Added handlers for all the new tools and aligned responses:
    • resolve_merge_request_thread
    • create_merge_request_discussion_note
    • update_merge_request_discussion_note
    • delete_merge_request_discussion_note
    • create_merge_request_note
    • update_merge_request_note
    • delete_merge_request_note
    • get_merge_request_note
    • get_merge_request_notes

Breaking Changes

  • Tool semantics adjusted:
    • Previously, update_merge_request_note updated discussion notes. Now, it updates MR-level notes.
    • Use update_merge_request_discussion_note for discussion notes going forward.
  • If your integration relied on the old semantics:
    • For discussion note updates, migrate to update_merge_request_discussion_note.
    • For MR-level note updates, keep using update_merge_request_note.

API Usage (Examples)

  • Create MR-level note:
    • create_merge_request_note { project_id, merge_request_iid, body }
  • Get MR-level notes:
    • get_merge_request_notes { project_id, merge_request_iid, sort?, order_by? }
  • Get/Update/Delete MR-level note:
    • get_merge_request_note
    • update_merge_request_note
    • delete_merge_request_note
  • Manage discussion notes within a thread:
    • create_merge_request_discussion_note
    • update_merge_request_discussion_note
    • delete_merge_request_discussion_note
  • Resolve/unresolve a discussion thread:
    • resolve_merge_request_thread { project_id, merge_request_iid, discussion_id, resolved? }

Testing Recommendations

  • Validate CRUD flows separately for discussion notes vs MR-level notes.
  • Verify resolve_merge_request_thread toggles resolution state correctly.
  • Exercise error paths (permission denied, missing resources, invalid params) to confirm error handling and messages.

Affected Files

  • index.ts (tool registration, request routing, and core GitLab API interactions)

…on note

Updated the naming of schemas and functions related to merge request notes to reflect their purpose as discussion notes. This includes renaming `CreateMergeRequestNoteSchema` to `CreateMergeRequestDiscussionNoteSchema`, `UpdateMergeRequestNoteSchema` to `UpdateMergeRequestDiscussionNoteSchema`, and corresponding functions for clarity and consistency.
Introduced new functions and schemas for managing merge request notes, including creating, updating, deleting, and listing notes. This enhances the API's capabilities for handling discussions within merge requests. Updated existing schemas to include `CreateMergeRequestNoteSchema`, `UpdateMergeRequestNoteSchema`, `DeleteMergeRequestNoteSchema`, `GetMergeRequestNoteSchema`, and `ListMergeRequestNotesSchema`.
…RequestNotesSchema

Cleaned up the ListMergeRequestNotesSchema by removing an unnecessary merge with PaginationOptionsSchema, streamlining the schema definition.
…otes

Implemented new functions and schemas for deleting and resolving discussion notes on merge requests. This includes the addition of `deleteMergeRequestDiscussionNote` and `resolveMergeRequestThread` functions, along with their corresponding schemas, enhancing the API's capabilities for managing merge request discussions.
Eliminated the 'mr_notes' entry from the allTools array in index.ts, streamlining the toolset for managing merge request discussions.
Renamed `ListMergeRequestNotesSchema` to `GetMergeRequestNotesSchema` and updated the corresponding function from `listMergeRequestNotes` to `getMergeRequestNotes`. Adjusted the allTools array to reflect these changes, enhancing clarity and consistency in the API for managing merge request notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant