delete_client
Remove a client from the Keycloak identity management server by specifying the client's database ID and optional realm. Returns a status message upon completion.
Instructions
Delete a client.
Args:
id: The client's database ID
realm: Target realm (uses default if not specified)
Returns:
Status message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| realm | No |
Implementation Reference
- src/tools/client_tools.py:220-232 (handler)The handler function for the 'delete_client' tool. It deletes a client by its database ID using the KeycloakClient's _make_request method with a DELETE request to /clients/{id}. Includes docstring describing args and return.async def delete_client(id: str, realm: Optional[str] = None) -> Dict[str, str]: """ Delete a client. Args: id: The client's database ID realm: Target realm (uses default if not specified) Returns: Status message """ await client._make_request("DELETE", f"/clients/{id}", realm=realm) return {"status": "deleted", "message": f"Client {id} deleted successfully"}
- src/tools/client_tools.py:220-220 (registration)The @mcp.tool() decorator registers the delete_client function as an MCP tool.async def delete_client(id: str, realm: Optional[str] = None) -> Dict[str, str]: