Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_realm_role

Retrieve a specific realm role by name from Keycloak identity management to manage access permissions and role configurations.

Instructions

Get a specific realm role by name.

Args:
    role_name: Role name
    realm: Target realm (uses default if not specified)

Returns:
    Role object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_nameYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the 'get_realm_role' tool. Decorated with @mcp.tool(), which registers it. Retrieves a specific realm role by name using the KeycloakClient.
    @mcp.tool()
    async def get_realm_role(role_name: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific realm role by name.
    
        Args:
            role_name: Role name
            realm: Target realm (uses default if not specified)
    
        Returns:
            Role object
        """
        return await client._make_request("GET", f"/roles/{role_name}", realm=realm)
  • The @mcp.tool() decorator registers the get_realm_role function as an MCP tool.
    @mcp.tool()
Behavior3/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 it's a read operation ('Get'), implying it's non-destructive, but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions, or what happens if the role doesn't exist. The description adds basic context but lacks depth for a tool with no annotation coverage.

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 well-structured and front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

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 low complexity (2 parameters, no nested objects) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose and parameters, but lacks behavioral details like error handling or prerequisites, which would be beneficial despite the output schema.

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?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: 'role_name' as 'Role name' and 'realm' as 'Target realm (uses default if not specified)', adding meaning beyond the bare schema. This covers the semantics adequately, though it doesn't detail format constraints (e.g., string patterns).

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: 'Get a specific realm role by name.' It specifies the verb ('Get') and resource ('realm role'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'list_realm_roles' or 'get_user_realm_roles', which would require more specificity for a perfect score.

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 sibling tools like 'list_realm_roles' (for listing all roles) or 'get_user_realm_roles' (for roles assigned to a user), leaving the agent to infer usage context without explicit direction.

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/idoyudha/mcp-keycloak'

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