Skip to main content
Glama

count_users

Retrieve the total number of users within a specified or default Keycloak realm. Simplifies user management by providing accurate counts for identity and access control.

Instructions

Count all users. Args: realm: Target realm (uses default if not specified) Returns: Number of users

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmNo

Implementation Reference

  • The handler function for the 'count_users' tool. It is decorated with @mcp.tool() for registration and uses KeycloakClient to fetch the user count from the '/users/count' endpoint.
    @mcp.tool() async def count_users(realm: Optional[str] = None) -> int: """ Count all users. Args: realm: Target realm (uses default if not specified) Returns: Number of users """ return await client._make_request("GET", "/users/count", realm=realm)

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