gitlab_get_user_mr_comments
Retrieve merge request comments and review feedback authored by a specific user in GitLab. Use to analyze code review participation, quality assurance, feedback impact, and team collaboration. Filter by user, project, date, or comment type.
Instructions
Get all comments authored by a user on merge requests
Find all merge request comments and review feedback provided by the specified user, including code review discussions.
Returns MR comment information with:
Comment details: content, type (review/discussion)
MR context: title, state, author, project
Review info: approval status, code line references
Thread info: discussion flow, resolution status
Impact: influence on code quality and decisions
Use cases:
Code review participation tracking
Quality assurance monitoring
Mentoring and feedback analysis
Team collaboration assessment
Parameters:
user_id: Numeric user ID
username: Username string (use either user_id or username)
project_id: Optional project scope filter
comment_type: Filter by type (review, discussion, all)
since: Comments after date (YYYY-MM-DD)
until: Comments before date (YYYY-MM-DD)
mr_state: Filter by MR state (opened, merged, closed, all)
sort: Sort order (created, updated, project)
per_page: Results per page (default: 20)
page: Page number (default: 1)
Example: Get code review comments from last month
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets | |
| per_page | No | Number of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing | |
| project_id | No | Optional project scope filter | |
| since | No | Comments after date (YYYY-MM-DD) | |
| until | No | Comments before date (YYYY-MM-DD) | |
| username | Yes | Username string |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:938-958 (handler)The main handler function that implements the gitlab_get_user_mr_comments tool. It extracts parameters, validates username, and delegates to GitLabClient.get_user_mr_comments.def handle_get_user_mr_comments(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting user's MR comments""" username = get_argument(arguments, "username") if not username: raise ValueError("username is required") project_id = get_argument(arguments, "project_id") since = get_argument(arguments, "since") until = get_argument(arguments, "until") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.get_user_mr_comments( username=username, project_id=project_id, since=since, until=until, per_page=per_page, page=page )
- Pydantic/MCP schema definition for the tool, including input parameters and validation rules.types.Tool( name=TOOL_GET_USER_MR_COMMENTS, description=desc.DESC_GET_USER_MR_COMMENTS, inputSchema={ "type": "object", "properties": { "username": {"type": "string", "description": "Username string"}, "project_id": {"type": "string", "description": "Optional project scope filter"}, "since": {"type": "string", "description": "Comments after date (YYYY-MM-DD)"}, "until": {"type": "string", "description": "Comments before date (YYYY-MM-DD)"}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["username"] } ),
- src/mcp_gitlab/tool_handlers.py:1092-1097 (registration)Registration of the handler in the TOOL_HANDLERS dictionary, which maps tool names to their handler functions. Used by server.py to dispatch calls.# User's Comments & Discussions handlers TOOL_GET_USER_ISSUE_COMMENTS: handle_get_user_issue_comments, TOOL_GET_USER_MR_COMMENTS: handle_get_user_mr_comments, TOOL_GET_USER_DISCUSSION_THREADS: handle_get_user_discussion_threads, TOOL_GET_USER_RESOLVED_THREADS: handle_get_user_resolved_threads, }
- src/mcp_gitlab/constants.py:272-272 (helper)Constant defining the exact tool name string used throughout the codebase.TOOL_GET_USER_MR_COMMENTS = "gitlab_get_user_mr_comments"
- src/mcp_gitlab/server.py:1193-1207 (registration)Tool schema also defined in server.list_tools() for MCP protocol compliance.name=TOOL_GET_USER_MR_COMMENTS, description=desc.DESC_GET_USER_MR_COMMENTS, inputSchema={ "type": "object", "properties": { "username": {"type": "string", "description": "Username string"}, "project_id": {"type": "string", "description": "Optional project scope filter"}, "since": {"type": "string", "description": "Comments after date (YYYY-MM-DD)"}, "until": {"type": "string", "description": "Comments before date (YYYY-MM-DD)"}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["username"] } ),