Skip to main content
Glama

list-users

Retrieve all users within a specified Keycloak realm to manage user accounts and access permissions.

Instructions

List users in a specific realm

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmYes

Implementation Reference

  • The handler function for the 'list-users' tool. It parses the input arguments using ListUsersSchema, configures the Keycloak client for the specified realm, fetches the list of users using kcAdminClient.users.find(), and returns a formatted text response listing the users with their usernames and IDs.
    case "list-users": {
      const { realm } = ListUsersSchema.parse(args);
      
      kcAdminClient.setConfig({
        realmName: realm
      });
    
      const users = await kcAdminClient.users.find();
      
      return {
        content: [{
          type: "text",
          text: `Users in realm ${realm}:\n${users.map(u => `- ${u.username} (${u.id})`).join('\n')}`
        }]
      };
    }
  • Zod schema for validating the input parameters of the 'list-users' tool, requiring a 'realm' string.
    const ListUsersSchema = z.object({
      realm: z.string()
    });
  • src/index.ts:83-93 (registration)
    The tool registration entry for 'list-users' in the listTools response, including name, description, and inputSchema matching the ListUsersSchema.
    {
      name: "list-users",
      description: "List users in a specific realm",
      inputSchema: {
        type: "object",
        properties: {
          realm: { type: "string" }
        },
        required: ["realm"]
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation (implying read-only), but doesn't mention permissions needed, pagination behavior, rate limits, or what the output looks like. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple list tool and front-loads the essential information ('List users'). Every word earns its place.

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?

Given no annotations, 0% schema coverage, and no output schema, the description is insufficiently complete. It covers the basic purpose but lacks parameter details, behavioral context, and output information that would help an agent use this tool effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so the single parameter 'realm' is undocumented in the schema. The description adds minimal value by mentioning 'specific realm', but doesn't explain what a realm is, provide format examples, or clarify if it's a name, ID, or something else. It doesn't compensate for the schema coverage gap.

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?

The description clearly states the action ('List') and resource ('users in a specific realm'), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like 'list-realms' or 'create-user', but the specificity of 'users' vs 'realms' provides implicit differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list-realms' or 'create-user'. It mentions 'specific realm' which hints at a prerequisite, but offers no explicit usage context, exclusions, or comparison to sibling tools.

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/ChristophEnglisch/keycloak-model-context-protocol'

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