Skip to main content
Glama

gitlab_get_user_open_mrs

Retrieve all open merge requests authored by a specific user across accessible GitLab projects, providing status, priority indicators, and project context for review management and workload tracking.

Instructions

Get all open merge requests authored by a user

Retrieve all currently open MRs created by the specified user across all accessible projects, with priority and urgency indicators.

Returns MR information including:

  • Basic details: title, description, IID

  • Status: draft, conflicts, approvals needed

  • Urgency indicators: age, reviewer assignments

  • CI status: pipeline state, test results

  • Project context: name, namespace

Use cases:

  • Personal MR dashboard

  • Team workload monitoring

  • Code review queue management

  • Sprint planning and tracking

Parameters:

  • user_id: Numeric user ID

  • username: Username string (use either user_id or username)

  • sort: Sort order (updated, created, priority)

  • per_page: Results per page (default: 20)

  • page: Page number (default: 1)

Example: Get user's open MRs sorted by update time

{
  "username": "johndoe",
  "sort": "updated",
  "per_page": 10  
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoNumeric user ID
usernameNoUsername string
sortNoSort orderupdated
per_pageNoNumber 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
pageNoPage 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

Implementation Reference

  • Handler function that executes the core logic of the gitlab_get_user_open_mrs tool by parsing arguments and calling the GitLabClient method.
    def handle_get_user_open_mrs(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]:
        """Handle getting user's open merge requests"""
        user_id = get_argument(arguments, "user_id")
        username = get_argument(arguments, "username")
        sort = get_argument(arguments, "sort", "updated")
        per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE)
        page = get_argument(arguments, "page", 1)
        
        return client.get_user_open_mrs(
            user_id=user_id,
            username=username,
            sort=sort,
            per_page=per_page,
            page=page
        )
  • MCP tool schema definition specifying input parameters, types, descriptions, and validation rules for the tool.
    types.Tool(
        name=TOOL_GET_USER_OPEN_MRS,
        description=desc.DESC_GET_USER_OPEN_MRS,
        inputSchema={
            "type": "object",
            "properties": {
                "username": {"type": "string", "description": "Username string"},
                "scope": {"type": "string", "description": "MR scope", "enum": ["created", "assigned", "all"], "default": "created"},
                "draft": {"type": "string", "description": "Filter by draft status", "enum": ["yes", "no", "all"], "default": "all"},
                "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"]
        }
    ),
  • Mapping of tool name to its handler function in the TOOL_HANDLERS dictionary used for tool dispatch.
    TOOL_GET_USER_OPEN_MRS: handle_get_user_open_mrs,
  • Constant definition for the tool name string used across the codebase.
    TOOL_GET_USER_OPEN_MRS = "gitlab_get_user_open_mrs"
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server