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
- Test retrieving a specific discussion thread
- Test resolving/unresolving MR discussions
- Test creating new general discussion threads
- Test creating code-positioned discussion threads
- Verify discussion operations work for issues and epics
Related Issues
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