Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

delete_realm_role

Remove a role from a Keycloak realm to manage user permissions and access control. Specify the role name and optionally the target realm.

Instructions

Delete a realm role.

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

Returns:
    Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_nameYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for delete_realm_role tool. Deletes the specified realm role using KeycloakClient and returns success status.
    @mcp.tool()
    async def delete_realm_role(
        role_name: str, realm: Optional[str] = None
    ) -> Dict[str, str]:
        """
        Delete a realm role.
    
        Args:
            role_name: Role name to delete
            realm: Target realm (uses default if not specified)
    
        Returns:
            Status message
        """
        await client._make_request("DELETE", f"/roles/{role_name}", realm=realm)
        return {
            "status": "deleted",
            "message": f"Realm role {role_name} deleted successfully",
        }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a deletion operation (implying mutation/destructive), but doesn't describe critical behaviors: whether deletion is permanent, what happens to existing role assignments, permission requirements, error conditions, or side effects. The description adds minimal value beyond the obvious implication of 'delete'.

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 efficiently structured with a clear purpose statement followed by organized Arg/Return sections. Every sentence adds value: the first establishes the core action, and the parameter explanations provide necessary context without redundancy. No wasted words or unnecessary elaboration.

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

Completeness3/5

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

Given this is a destructive mutation tool with no annotations, the description is minimally adequate. The presence of an output schema means return values are documented elsewhere, reducing the burden. However, for a deletion operation affecting security roles, more context about prerequisites, consequences, and error handling would be valuable for safe agent operation.

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 description adds meaningful context for both parameters beyond the 0% schema description coverage. It clarifies that 'role_name' is 'Role name to delete' (not just any string) and that 'realm' is the 'Target realm (uses default if not specified)', explaining the optional nature and default behavior. This compensates well for the schema's lack of descriptions.

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 verb 'Delete' and resource 'realm role', making the purpose unambiguous. It distinguishes from siblings like 'delete_client' or 'delete_user' by specifying the resource type. However, it doesn't explicitly differentiate from 'remove_realm_role_from_user' which removes role assignments rather than deleting the role itself.

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 (e.g., role must exist, no active assignments), consequences (e.g., irreversible deletion), or relationships with sibling tools like 'remove_realm_role_from_user' or 'update_realm_role'. The agent must infer usage context from the tool name 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/idoyudha/mcp-keycloak'

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