Skip to main content
Glama

gitlab_get_user

Retrieve basic profile information for a specific GitLab user by providing their ID or exact username. Returns essential details like name, username, avatar, and public profile data.

Instructions

Get basic profile information for a specific GitLab user by ID or username.

Returns essential user details like name, username, avatar, and public profile info. Use this tool when you have a specific user ID or exact username and need basic profile information.

Parameters:

  • user_id: Numeric user ID (e.g., 12345)

  • username: Username string (e.g., 'johndoe')

Use either user_id OR username, not both.

Examples:

  • Get user profile for @mentions: get_user(username="johndoe")

  • Look up user from commit author: get_user(user_id=12345)

  • Display user info in applications

For searching users with partial information, use 'gitlab_search_user' instead. For comprehensive user activity and contributions, use user activity tools instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoUser ID (numeric) Type: integer Format: Numeric user ID Example: 12345 How to find: From user profile URL or API responses
usernameNoGitLab username Type: string Format: Username without @ symbol Case: Case-sensitive Required: Yes Examples: - 'johndoe' (for @johndoe) - 'mary-smith' (for @mary-smith) - 'user123' (for @user123) Note: This is the username, not display name or email

Implementation Reference

  • The handler function that executes the core logic of the gitlab_get_user tool by calling the GitLabClient's get_user method with either user_id or username.
    def handle_get_user(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]:
        """Handle getting user details by ID or username"""
        user_id = get_argument(arguments, "user_id")
        username = get_argument(arguments, "username")
        
        if not user_id and not username:
            raise ValueError("Either user_id or username must be provided")
        
        result = client.get_user(user_id=user_id, username=username)
        if result is None:
            raise ValueError(f"User not found: {user_id or username}")
        
        return result
  • Registration of the handler function in the TOOL_HANDLERS dictionary, mapping the tool name 'gitlab_get_user' to its handler.
    TOOL_GET_USER: handle_get_user,
  • MCP tool schema definition in list_tools(), specifying the input schema requiring either user_id (integer) or username (string).
    types.Tool(
        name=TOOL_GET_USER,
        description=desc.DESC_GET_USER,
        inputSchema={
            "type": "object",
            "properties": {
                "user_id": {"type": "integer", "description": desc.DESC_USER_ID},
                "username": {"type": "string", "description": desc.DESC_USERNAME}
            }
        }
    ),
  • Constant defining the tool name 'gitlab_get_user' used for registration and mapping throughout the codebase.
    TOOL_GET_USER = "gitlab_get_user"

Tool Definition Quality

Score is being calculated. Check back soon.

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