create_user
Add new user accounts with specific roles and permissions in Coroot's observability platform. Requires administrator access to configure user access.
Instructions
Create a new user (admin only).
Creates a new user account with specified role and permissions. Requires admin privileges.
Args: user_data: New user information including email, name, role
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_data | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1647-1656 (handler)Primary MCP tool handler for 'create_user', registered via @mcp.tool() decorator. Delegates to internal implementation.async def create_user(user_data: dict[str, Any]) -> dict[str, Any]: """Create a new user (admin only). Creates a new user account with specified role and permissions. Requires admin privileges. Args: user_data: New user information including email, name, role """ return await create_user_impl(user_data) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1636-1644 (helper)Internal helper function that invokes the CorootClient.create_user method and formats the response.async def create_user_impl(user_data: dict[str, Any]) -> dict[str, Any]: """Create a new user.""" result = await get_client().create_user(user_data) return { "success": True, "message": "User created successfully", "user": result, }
- src/mcp_coroot/client.py:1283-1305 (helper)CorootClient method that executes the actual HTTP POST request to /api/users endpoint to create the user.async def create_user(self, user_data: dict[str, Any]) -> dict[str, Any]: """Create a new user (admin only). Args: user_data: New user data with fields: - email: User email - name: Display name - role: Admin|Editor|Viewer - password: Initial password Returns: Created user. """ # Add action field required by Coroot request_data = {"action": "create", **user_data} response = await self._request( "POST", "/api/users", json=request_data, ) data: dict[str, Any] = response.json() return data
- src/mcp_coroot/server.py:1648-1655 (schema)Docstring providing the tool schema description, input parameters for the MCP tool."""Create a new user (admin only). Creates a new user account with specified role and permissions. Requires admin privileges. Args: user_data: New user information including email, name, role """
- src/mcp_coroot/client.py:1284-1295 (schema)Detailed schema documentation in client method docstring specifying exact user_data fields required."""Create a new user (admin only). Args: user_data: New user data with fields: - email: User email - name: Display name - role: Admin|Editor|Viewer - password: Initial password Returns: Created user. """