gitlab_get_user_discussion_threads
Retrieve and analyze all discussion threads initiated by a user on GitLab, including details like context, engagement, and timeline. Use for tracking contributions, assessing communication, and gaining team collaboration insights.
Instructions
Get all discussion threads started by a user
Find all discussion threads initiated by the specified user across issues, merge requests, and other collaborative contexts.
Returns discussion thread information with:
Thread details: initial message, topic, context
Engagement: replies, participants, resolution
Origin: issue/MR association, project context
Timeline: creation, activity, resolution dates
Impact: influence on decisions and outcomes
Use cases:
Leadership and initiative tracking
Communication effectiveness analysis
Knowledge sharing assessment
Team collaboration insights
Parameters:
user_id: Numeric user ID
username: Username string (use either user_id or username)
project_id: Optional project scope filter
context_type: Filter by context (Issue, MergeRequest, all)
status: Filter by resolution status (active, resolved, all)
since: Threads started after date (YYYY-MM-DD)
until: Threads started before date (YYYY-MM-DD)
sort: Sort order (created, activity, resolution)
per_page: Results per page (default: 20)
page: Page number (default: 1)
Example: Get active discussion threads
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 | |
| thread_status | No | Filter by thread status | |
| username | Yes | Username string |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:960-977 (handler)The handler function that executes the tool logic: extracts parameters like username, project_id, etc., and calls the GitLabClient's get_user_discussion_threads method.def handle_get_user_discussion_threads(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting user's discussion threads""" username = get_argument(arguments, "username") if not username: raise ValueError("username is required") project_id = get_argument(arguments, "project_id") thread_status = get_argument(arguments, "thread_status") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.get_user_discussion_threads( username=username, project_id=project_id, thread_status=thread_status, per_page=per_page, page=page )
- Pydantic/MCP input schema definition for the tool, specifying parameters like username (required), project_id, thread_status, pagination.types.Tool( name=TOOL_GET_USER_DISCUSSION_THREADS, description=desc.DESC_GET_USER_DISCUSSION_THREADS, inputSchema={ "type": "object", "properties": { "username": {"type": "string", "description": "Username string"}, "project_id": {"type": "string", "description": "Optional project scope filter"}, "thread_status": {"type": "string", "description": "Filter by thread status", "enum": ["resolved", "unresolved"]}, "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:1095-1095 (registration)Registration of the tool name to its handler function in the TOOL_HANDLERS dictionary used by the server.TOOL_GET_USER_DISCUSSION_THREADS: handle_get_user_discussion_threads,
- src/mcp_gitlab/constants.py:273-273 (registration)Constant definition of the tool name string.TOOL_GET_USER_DISCUSSION_THREADS = "gitlab_get_user_discussion_threads"