list_users
Retrieve a list of all system users with their roles and permissions. Requires admin access to manage and oversee user data efficiently.
Instructions
List all users in the system (admin only).
Returns all users with their roles and permissions. Requires admin privileges.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_coroot/server.py:1617-1623 (handler)Primary handler logic for the MCP 'list_users' tool. Calls the CorootClient.list_users() method and wraps the response in a success dictionary."""List all users.""" users = await get_client().list_users() return { "success": True, "users": users, }
- src/mcp_coroot/server.py:1625-1633 (registration)Registration of the 'list_users' MCP tool using the FastMCP @mcp.tool() decorator. This makes the function available as an MCP tool.@mcp.tool() async def list_users() -> dict[str, Any]: """List all users in the system (admin only). Returns all users with their roles and permissions. Requires admin privileges. """ return await list_users_impl() # type: ignore[no-any-return]
- src/mcp_coroot/client.py:1273-1281 (helper)Supporting client method in CorootClient that performs the actual HTTP GET request to the Coroot API endpoint /api/users and parses the JSON response.async def list_users(self) -> dict[str, Any]: """List all users (admin only). Returns: List of all users. """ response = await self._request("GET", "/api/users") data: dict[str, Any] = response.json() return data