Skip to main content
Glama
mgcrea

@mgcrea/mcp-keycloak

by mgcrea

keycloak_get_user_role_mappings

Read-only

Retrieve a Keycloak user's role mappings, showing direct roles by default or all effective roles when requested.

Instructions

Get a user's role mappings. By default returns only roles assigned DIRECTLY to the user; set effective to also include roles inherited from groups and from composite roles — that is the set that actually lands in their token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmNoRealm to operate on. Defaults to the server's configured realm (KEYCLOAK_REALM).
userIdYesUser UUID (the `id` field), NOT the username. Find it with keycloak_list_users.
effectiveNoInclude roles inherited via groups and composites.
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the read-only nature is covered. The description adds meaningful behavioral context beyond the annotation: default direct-only semantics, inclusion of inherited and composite roles when `effective` is set, and the consequence that this matches the token's role set. No contradictions.

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?

Two sentences, no filler, and the most important behavioral distinction is front-loaded. Every clause contributes to correct usage.

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

Completeness4/5

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

For a simple read-only lookup with well-documented parameters and a readOnly annotation, the description is largely complete. The main gap is that no output schema exists and the response shape is not described, but the domain concept of role mappings makes the return type reasonably predictable.

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 coverage is 100% with strong descriptions for `realm`, `userId`, and `effective`. The free-text description adds value beyond the schema by explaining that `effective` produces the set that 'actually lands in their token,' which gives the agent a clearer reason to set the flag.

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?

The description states a specific verb and resource: retrieving a user's role mappings. It further clarifies the direct vs. effective distinction, which sets it apart from siblings like keycloak_get_group_role_mappings and makes its scope immediately clear.

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?

The default behavior is explicit, and the description tells the agent when to set `effective` — when inherited roles and the actual token role set are wanted. It doesn't name sibling alternatives explicitly, but the direct/effective guidance is actionable and clear.

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

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

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