get_current_user
Retrieve authenticated user details including email, roles, and accessible projects from the Coroot observability platform.
Instructions
Get current authenticated user information.
Returns information about the currently authenticated user including their email, name, roles, and accessible projects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_coroot/server.py:128-136 (handler)MCP tool handler function for 'get_current_user'. This is the entry point registered with FastMCP that executes the tool logic by calling the implementation wrapper.@mcp.tool() async def get_current_user() -> dict[str, Any]: """Get current authenticated user information. Returns information about the currently authenticated user including their email, name, roles, and accessible projects. """ return await get_current_user_impl() # type: ignore[no-any-return]
- src/mcp_coroot/client.py:278-287 (helper)Low-level CorootClient method that implements the core logic: makes authenticated GET request to /api/user endpoint and returns the parsed user data.async def get_current_user(self) -> dict[str, Any]: """Get current authenticated user information. Returns: User information dictionary. """ response = await self._request("GET", "/api/user") data: dict[str, Any] = response.json() return data
- src/mcp_coroot/server.py:128-136 (registration)Registration of the 'get_current_user' tool using FastMCP @mcp.tool() decorator, which handles schema inference from signature and docstring.@mcp.tool() async def get_current_user() -> dict[str, Any]: """Get current authenticated user information. Returns information about the currently authenticated user including their email, name, roles, and accessible projects. """ return await get_current_user_impl() # type: ignore[no-any-return]
- src/mcp_coroot/server.py:119-126 (helper)Implementation wrapper that calls the client method, adds success wrapper, and is decorated with error handler.async def get_current_user_impl() -> dict[str, Any]: """Get current authenticated user information.""" user = await get_client().get_current_user() return { "success": True, "user": user, }