Skip to main content
Glama
mgcrea

@mgcrea/mcp-keycloak

by mgcrea

keycloak_count_users

Read-only

Count Keycloak users that match filters like username, email, realm, or custom attributes, returning only the count without fetching user details.

Instructions

Count users matching a filter, without fetching them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoSearch custom user ATTRIBUTES: space-separated key:value pairs, e.g. "department:sales tier:gold". This is the only way to filter on attributes.
emailNoFilter by email. Pair with `exact` for an exact match.
exactNoMake `username`/`email`/`firstName`/`lastName` exact rather than prefix matches.
realmNoRealm to operate on. Defaults to the server's configured realm (KEYCLOAK_REALM).
searchNoInfix search across username, first name, last name and email. A prefix match by default; wrap in quotes ("bob") for an exact match.
enabledNoOnly enabled (true) or only disabled (false) users.
lastNameNo
usernameNoFilter by username. Pair with `exact` for an exact match.
firstNameNo
emailVerifiedNo
Install Server

TDQS

A3.8/5.0
Behavior3/5

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

The readOnlyHint annotation already establishes the tool is safe, and the description adds one useful behavioral detail: it returns a count without fetching user objects. No further behavioral context (return shape, large-dataset behavior) is disclosed, and nothing contradicts the annotation.

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?

Nine words, front-loaded with verb and object, and the differentiating clause 'without fetching them' earns its place. There is no filler or repetition of schema contents.

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?

For a read-only count operation, the description plus the heavily documented schema is nearly sufficient: the contrast with user-listing tools is clear and count semantics are self-evident. It stops short of perfect because it relies on inference for the return format and never explicitly names keycloak_list_users as the alternative.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 70%, so most parameters are already documented in the schema. The description contributes only the generic phrase 'matching a filter,' adding no meaning about individual parameters such as q, email, or exact, and it does not compensate for the three undocumented fields (lastName, firstName, emailVerified).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Count') with a specific resource ('users') and scope ('matching a filter'). The clause 'without fetching them' directly distinguishes it from siblings like keycloak_list_users and keycloak_get_user that retrieve user records.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the use case: pick this tool when the agent needs a count rather than the actual user data. However, it never names an alternative explicitly or states when not to use it, leaving the agent to infer the boundary with keycloak_list_users from the sibling list alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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