gitlab_get_current_user
Retrieve the authenticated user's profile from GitLab to verify authentication, access user context for automation, and check permissions and account details.
Instructions
Get the currently authenticated user's profile Returns comprehensive information about the authenticated user including:
Basic info: ID, username, name, email
Profile details: bio, organization, job title
Account status: state, creation date, admin status
Permissions: can_create_group, can_create_project
Security: two_factor_enabled, external status
Use cases:
Verify authentication is working
Get user context for automation scripts
Check user permissions and capabilities
Display user info in applications
Example response: {'id': 123, 'username': 'johndoe', 'name': 'John Doe', ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:253-256 (handler)The core handler function that implements the tool logic by delegating to the GitLabClient's get_current_user() method.def handle_get_current_user(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting the current authenticated user""" return client.get_current_user()
- The tool schema definition, specifying no input parameters as this tool requires none.name=TOOL_GET_CURRENT_USER, description=desc.DESC_GET_CURRENT_USER, inputSchema={ "type": "object", "properties": {} } ),
- src/mcp_gitlab/tool_handlers.py:1026-1027 (registration)Registration of the handler function in the TOOL_HANDLERS dictionary mapping tool name to handler.TOOL_GET_CURRENT_USER: handle_get_current_user, TOOL_GET_USER: handle_get_user,
- src/mcp_gitlab/constants.py:187-187 (helper)Constant definition for the tool name used across the codebase.TOOL_GET_CURRENT_USER = "gitlab_get_current_user"