Skip to main content
Glama

delete_realm_role

Remove a specific role from a Keycloak realm by providing the role name and optional realm. Streamline role management and access control with this targeted deletion tool.

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
realmNo
role_nameYes

Implementation Reference

  • The async handler function for the 'delete_realm_role' MCP tool, decorated with @mcp.tool(). It deletes the specified realm role by making a DELETE request to the Keycloak API endpoint /roles/{role_name} using the shared KeycloakClient instance.
    @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", }

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