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"
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns 'essential user details like name, username, avatar, and public profile info,' which clarifies the scope and output. However, it doesn't mention rate limits, authentication requirements, or error conditions, leaving some behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections: purpose, return values, usage guidelines, parameters, examples, and alternatives. Every sentence adds value without redundancy, and key information is front-loaded (e.g., purpose and when-to-use in the first two sentences).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple read operation with 2 parameters, the description is mostly complete. It covers purpose, usage, parameters, and alternatives effectively. However, it lacks details on output format or potential errors, which could be helpful for an agent, though not critical for this tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds value by clarifying the mutual exclusivity ('Use either user_id OR username, not both') and providing usage examples, but doesn't add significant semantic details beyond what's in the schema. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get basic profile information'), target resource ('for a specific GitLab user'), and method ('by ID or username'). It distinguishes from siblings like 'gitlab_search_user' by emphasizing exact identification versus partial search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('when you have a specific user ID or exact username and need basic profile information') and when not to use ('For searching users with partial information, use 'gitlab_search_user' instead'). It also mentions alternatives for more comprehensive data ('For comprehensive user activity and contributions, use user activity tools instead').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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