Skip to main content
Glama
Keycloak MCP Server

Keycloak MCP Server

by M0-AR

find-users-with-role

Retrieves users assigned to a specific role in a Keycloak realm. Use it to audit role membership or page through results with first and max parameters.

Instructions

Find users with a specific role

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "realm": "<realm>",
      "roleName": "<roleName>"
    },
    "name": "find-users-with-role"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxNoMaximum results
firstNoFirst result index
realmYesRealm name
roleNameYesRole name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses almost nothing. 'Find' implies a read-only lookup, but there is no statement about pagination behavior, result limits, or what happens when the role or realm does not exist.

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?

The single short sentence is front-loaded and contains no wasted wording. It is lean, though the leanness reflects under-specification rather than disciplined editing.

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

Completeness2/5

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

With four parameters, two of them required, no annotations, and no output schema, the description leaves the agent without the context needed to call the tool confidently. It does not say what comes back, how results are ordered, or how paging interacts with first and max.

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 100%, so realm, roleName, first, and max are all documented in the schema itself. The description adds no meaning beyond that, which is the expected baseline when the schema does the work.

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

Purpose2/5

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

The description "Find users with a specific role" is essentially the tool name (find-users-with-role) restated with spaces. It does identify a verb and a resource, but it adds no scope or constraints beyond what the name already conveys, which places it at the tautology level.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus list-users or search-users, and no mention of prerequisites such as needing a realm or role to exist. The agent must infer the retrieval-vs-listing distinction from sibling names alone.

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

Deploy Server

Other Tools