get_roles
Retrieve all available user roles (e.g., Viewer, Editor, Admin) for assignment within the Coroot observability platform, ensuring precise access control and management.
Instructions
Get available user roles.
Returns all available roles that can be assigned to users (e.g., Viewer, Editor, Admin).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_coroot/server.py:1669-1676 (handler)MCP tool registration and handler for 'get_roles'. This is the entry point decorated with @mcp.tool() that executes the tool logic by calling the implementation wrapper.@mcp.tool() async def get_roles() -> dict[str, Any]: """Get available user roles. Returns all available roles that can be assigned to users (e.g., Viewer, Editor, Admin). """ return await get_roles_impl() # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1660-1666 (helper)Helper implementation that wraps the client.get_roles() call, adds success wrapper, and handles via @handle_errors decorator.async def get_roles_impl() -> dict[str, Any]: """Get available roles.""" roles = await get_client().get_roles() return { "success": True, "roles": roles, }
- src/mcp_coroot/client.py:1372-1380 (helper)Core API client method that performs the HTTP GET request to /api/roles to fetch the roles data.async def get_roles(self) -> dict[str, Any]: """Get available roles. Returns: List of available roles. """ response = await self._request("GET", "/api/roles") data: dict[str, Any] = response.json() return data