Skip to main content
Glama
Keycloak MCP Server

Keycloak MCP Server

by Cayetano97

list_realm_role_users

Retrieve users assigned to a specified realm role in Keycloak, with pagination and optional brief representations for role-based user audits.

Instructions

List users that have the specified realm 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>",
      "role_name": "<role_name>"
    },
    "name": "list_realm_role_users"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxNoMaximum results size
firstNoPagination offset
realmYesRealm name
role_nameYesRole name
briefRepresentationNoBoolean which defines whether brief representations are returned (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description carries the full burden and does not meet it. It never says the call is read-only, what permissions are needed, whether results are paginated by default, or — critically for role tooling — whether it returns direct role assignments or effective/inherited members.

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?

A single front-loaded sentence with zero filler, and the operative constraint (realm role) comes before anything else. Its brevity is efficient rather than padded, though it leaves the definition thin overall.

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 five parameters, no annotations, and no output schema, a one-sentence description is not enough. An agent cannot tell the return shape, default page size, whether briefRepresentation defaults to full objects, or whether the list reflects direct or effective role membership.

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 max, first, realm, role_name, and briefRepresentation are already documented. The description adds no meaning beyond the schema, such as how 'first' interacts with 'max' or what a brief representation omits, 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.

Purpose4/5

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

States a specific verb and resource ('List users that have the specified realm role'), and the 'realm role' qualifier distinguishes it from list_client_role_users and list_users. It stops short of naming those siblings explicitly, so an agent must infer the boundary from the qualifier alone.

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 pick this over list_users (all users) or list_client_role_users (client-scoped roles). The realm-role scoping is implied by the name and description, but no exclusions, prerequisites, or alternative routing are given.

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