get_user_info
Retrieve details about the currently logged-in user, including permissions and groups, directly from the ArgoCD session for efficient access control and management.
Instructions
Get the current user's info via session/userinfo
This endpoint returns information about the currently logged-in user,
including permissions and groups.
Returns:
User information from ArgoCD
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/session.py:8-27 (handler)The asynchronous handler function for the 'get_user_info' MCP tool. It fetches the current user's information from the ArgoCD 'session/userinfo' API endpoint using the make_api_request helper and returns a dictionary with the user data or an error.async def get_user_info() -> Dict[str, Any]: """ Get the current user's info via session/userinfo This endpoint returns information about the currently logged-in user, including permissions and groups. Returns: User information from ArgoCD """ # Use the session userinfo endpoint with global setting from client.py success, data = await make_api_request("session/userinfo") if success: # Return the full user info response return data else: # Make sure to return a properly structured error dictionary return {"error": data.get("error", "Failed to retrieve user information")}
- server.py:30-31 (registration)Registration of the get_user_info tool on the FastMCP server instance using the mcp.tool() decorator. The session module is imported earlier on line 16.# Register session service tool - only provides user info via userinfo endpoint mcp.tool()(session.get_user_info)