Add discussion thread management tools (Phase 2 of #3)

What does this MR do?

This MR implements Phase 1 of discussion thread support by adding comprehensive discussion thread management tools for merge requests, issues, and epics.

Problem to solve

Currently, the GitLab plugin lacks the ability to:

  • Retrieve specific discussion threads with all their replies
  • Resolve and unresolve discussion threads in merge requests
  • Create new discussion threads (both general comments and code-positioned comments)

This limits the ability to effectively manage code review conversations and collaborate on merge requests.

Solution

Added new MCP tools for discussion thread management:

Merge Request Discussion Tools

  • gitlab_get_mr_discussion - Get a specific discussion thread with all replies
  • gitlab_resolve_mr_discussion - Mark a discussion thread as resolved
  • gitlab_unresolve_mr_discussion - Reopen a resolved discussion thread
  • gitlab_create_mr_discussion - Start a new discussion thread (supports code-positioned comments)

Issue Discussion Tools

  • gitlab_get_issue_discussion - Get a specific issue discussion thread with all replies

Epic Discussion Tools

  • gitlab_get_epic_discussion - Get a specific epic discussion thread with all replies

Implementation Details

  • Added API client methods for discussion thread operations
  • Implemented proper URL encoding for project/group IDs
  • Added support for positioned code comments with full position object (base_sha, start_sha, head_sha, paths, line numbers)
  • Comprehensive tool descriptions with usage examples
  • Proper error handling and type safety

Validation Steps

  1. Test retrieving a specific discussion thread
  2. Test resolving/unresolving MR discussions
  3. Test creating new general discussion threads
  4. Test creating code-positioned discussion threads
  5. Verify discussion operations work for issues and epics

Partially implements #3 - Phase 1 of discussion thread support

Checklist

  • Added new API client methods
  • Implemented MCP tools with proper schemas
  • Added comprehensive descriptions and documentation
  • Code follows project conventions
  • Changes are backward compatible
Edited by Vladimir Glafirov

Merge request reports

Loading