Skip to main content
Glama
shigechika

keycloak-mcp

by shigechika

get_totp_users

Count users with TOTP configured in a Keycloak realm by scanning each user's credentials. Supports filtering by enabled users and a user cap to limit resource usage.

Instructions

Report how many users have TOTP (OTP) configured across the realm.

Enumerates users and inspects each one's credentials for an otp entry. KeyCloak has no bulk credential endpoint, so this makes one credential request per user (N+1) — expect it to be slow on large realms; bound it with max_users (which also short-circuits the user enumeration). Users whose credential lookup fails are counted separately and skipped, so a single transient error does not abort the whole scan.

Args: enabled_only: Only scan enabled users (default True). list_users: Include the list of usernames with TOTP (default True). max_users: Cap the number of users scanned (0 = all). When the cap is hit the percentage covers only the sample, not the realm.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_usersNo
list_usersNo
enabled_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations provided, so description fully covers behavioral traits: N+1 credential requests, slowness on large realms, max_users short-circuits, and error handling (failures counted and skipped). Excellent transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with a clear first sentence, a behavioral paragraph, and parameter documentation. Slightly long but every sentence adds essential context; no waste.

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

Completeness5/5

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

Given the tool's complexity (N+1, performance), the description covers all necessary context: how it works, limitations, parameter effects, and error handling. Output schema exists but description complements it. Fully complete.

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?

Schema has 0% description coverage, but description adds significant meaning: explains enabled_only (default True, scans only enabled users), list_users (includes username list), max_users (cap, 0=all, impact on percentage). Adds value beyond schema.

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?

Description clearly states it 'Report how many users have TOTP configured across the realm.' This is a specific verb-resource pair that distinguishes it from siblings like get_user_credentials or count_users.

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

Usage Guidelines4/5

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

Explicitly mentions the N+1 performance issue and advises bounding with max_users. Gives context on when to use (need TOTP counts) and implications of parameters. Lacks explicit alternatives but provides strong guidance.

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

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