Skip to main content
Glama
HaithamOumerzoug

Keycloak MCP Server

list-clients

Retrieve a list of clients in a specified Keycloak realm using the MCP server, enabling streamlined management of client configurations and permissions.

Instructions

List clients in a specific realm

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmYes

Implementation Reference

  • The core handler function that executes the 'list-clients' tool logic: validates input, queries Keycloak for clients in the specified realm, and formats the results as a string.
    public async listClients(args: unknown): Promise<string> {
      const { realm } = ListClientsSchema.parse(args);
      const clients: ClientRepresentation[] =
        await this.kcAdminClient.clients.find({ realm });
      return `Clients in realm ${realm}:\n${clients
        .map((c) => `- ${c.clientId} (${c.id})`)
        .join("\n")}`;
    }
  • Input schema (JSON Schema format) for the 'list-clients' tool, defining the required 'realm' parameter.
    "list-clients": {
      type: "object",
      properties: {
        realm: { type: "string" },
      },
      required: ["realm"],
    },
  • src/server.ts:67-70 (registration)
    Tool registration in the MCP server's ListTools handler, exposing name, description, and schema.
      name: "list-clients",
      description: "List clients in a specific realm",
      inputSchema: InputSchema["list-clients"],
    },
  • Dispatch handler in the CallToolRequest that invokes the KeycloakService.listClients method.
    case "list-clients":
      return {
        content: [
          { type: "text", text: await keycloakService.listClients(args) },
        ],
      };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose any behavioral traits like pagination, sorting, filtering beyond realm, rate limits, authentication needs, or what the output looks like. For a tool with zero annotation coverage, this is inadequate.

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 waste—it directly states the tool's purpose. It's appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

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, no output schema, and low schema coverage (0%), the description is incomplete. It covers the basic purpose but lacks critical context: no details on behavior, parameters, or return values. For a tool with such sparse structured data, the description should do more to compensate.

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 description must compensate. It mentions 'realm' as the parameter context but adds no meaning beyond what the schema name implies—no explanation of what a realm is, format examples, or constraints. With 1 undocumented parameter, the description fails to provide necessary semantic details.

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 ('clients'), and specifies the scope ('in a specific realm'). It distinguishes from siblings like list-users or list-groups by focusing on clients. However, it doesn't explicitly differentiate from list-client-roles, which is a similar but distinct operation.

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 minimal guidance by implying the tool is used when you need to list clients in a realm. It offers no explicit when-to-use advice, no alternatives (e.g., vs. list-client-roles), and no prerequisites or exclusions. The context is clear but lacks actionable usage instructions.

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

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

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