gitlab_get_current_user
Retrieve detailed profile information of the currently authenticated user on the MCP GitLab Server, including ID, permissions, and account status, to verify authentication, check capabilities, or use in automation scripts.
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 main handler function for the gitlab_get_current_user tool. It takes a GitLabClient instance and optional arguments (unused), and returns the result of client.get_current_user() which fetches the authenticated user's profile from the GitLab API.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()
- Pydantic/MCP schema definition for the gitlab_get_current_user tool. Defines it as taking no input parameters and provides a description.name=TOOL_GET_CURRENT_USER, description=desc.DESC_GET_CURRENT_USER, inputSchema={ "type": "object", "properties": {} } ),
- src/mcp_gitlab/tool_handlers.py:1026-1026 (registration)Registration of the handler function in the TOOL_HANDLERS dictionary used by the MCP server for tool dispatching.TOOL_GET_CURRENT_USER: handle_get_current_user,
- src/mcp_gitlab/server.py:203-208 (registration)Tool schema registration in the @server.list_tools() handler which provides the tool schema to MCP clients.name=TOOL_GET_CURRENT_USER, description=desc.DESC_GET_CURRENT_USER, inputSchema={ "type": "object", "properties": {} }
- src/mcp_gitlab/constants.py:187-187 (helper)Constant definition for the tool name used consistently across the codebase.TOOL_GET_CURRENT_USER = "gitlab_get_current_user"