Skip to main content
Glama
jamesbrink

MCP Server for Coroot

get_roles

Retrieve available user roles like Viewer, Editor, and Admin for assignment in the Coroot observability platform.

Instructions

Get available user roles.

Returns all available roles that can be assigned to users (e.g., Viewer, Editor, Admin).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and handler function for 'get_roles'. This is the entry point decorated with @mcp.tool() that executes the tool logic by calling the implementation.
    @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]
  • Helper implementation that wraps the client call to get_roles, adds success wrapper, and handles errors.
    async def get_roles_impl() -> dict[str, Any]:
        """Get available roles."""
        roles = await get_client().get_roles()
        return {
            "success": True,
            "roles": roles,
        }
  • CorootClient method that makes the actual API request to /api/roles to fetch the roles data. This is the core implementation called by the MCP tool chain.
    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
  • Utility function to lazily initialize and retrieve the shared CorootClient instance used by all tools.
    def get_client() -> CorootClient:
        """Get or create the client instance.
    
        Raises:
            ValueError: If no credentials are configured.
        """
        global _client
        if _client is None:
            try:
                _client = CorootClient()
            except ValueError as e:
                # Re-raise with more context
                raise ValueError(
                    "Coroot credentials not configured. "
                    "Please set COROOT_BASE_URL and either:\n"
                    "  - COROOT_USERNAME and COROOT_PASSWORD for automatic login\n"
                    "  - COROOT_SESSION_COOKIE for direct authentication\n"
                    "  - COROOT_API_KEY for data ingestion endpoints"
                ) from e
        return _client
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states this is a read operation ('Get') and hints at a list output ('Returns all available roles'), but lacks details on permissions, rate limits, pagination, or error conditions. For a tool with zero annotation coverage, this is insufficient behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with zero waste. The first sentence states the purpose, and the second clarifies the return value with examples. It's front-loaded and efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, read-only operation) and the presence of an output schema, the description is reasonably complete. It explains what the tool does and what it returns, though it could benefit from more behavioral context (e.g., permissions) since annotations are absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the output semantics ('Returns all available roles...'). This meets the baseline for tools with no parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with 'Get available user roles' (verb+resource) and elaborates on what 'roles' means with examples like 'Viewer, Editor, Admin'. However, it doesn't explicitly differentiate from sibling tools like 'list_users' or 'create_or_update_role', which are related but distinct operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for role assignment, or compare it to sibling tools like 'list_users' or 'create_or_update_role'. The agent must infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jamesbrink/mcp-coroot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server