Skip to content

feat: add inline comment support for merge requests#5

Closed
kishan0725 wants to merge 1 commit into
rifqi96:mainfrom
kishan0725:feature/add-inline-comments-tools
Closed

feat: add inline comment support for merge requests#5
kishan0725 wants to merge 1 commit into
rifqi96:mainfrom
kishan0725:feature/add-inline-comments-tools

Conversation

@kishan0725
Copy link
Copy Markdown

Add support for creating inline/line-level comments on merge request diffs using GitLab's Discussions API. This enables AI assistants to provide precise, line-specific code review feedback similar to human reviewers.

What's Added

New Tools

  • gitlab_create_merge_request_discussion: Full-featured tool for creating
    inline comments with manual commit SHA specification
  • gitlab_create_merge_request_discussion_simple: Simplified tool that
    automatically fetches commit SHAs from the merge request

Implementation Details

  • Created src/types/repository.types.ts with proper TypeScript interfaces
    for discussion positions and diff references
  • Added handlers in src/handlers/repository-handlers.ts using GitLab's
    Discussions API endpoint
  • Registered tools in tool registry
  • Auto-generated documentation in TOOLS.md

Usage Example

The simplified version makes it easy to add inline comments:

{
  "project_id": "my-project",
  "merge_request_iid": 42,
  "body": "Consider using async/await here for better readability",
  "file_path": "src/server.ts",
  "line_number": 45,
  "line_type": "new"
}

@kishan0725
Copy link
Copy Markdown
Author

Closing the PR as updated PR is #6

@kishan0725 kishan0725 closed this Dec 30, 2025
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