Skip to main content
Glama
mgcrea

@mgcrea/mcp-keycloak

by mgcrea

keycloak_whoami

Read-only

Show the Keycloak server's authenticated identity and effective realm-management roles, reading role mappings from the server rather than the token. Use this first when another tool returns 403.

Instructions

Show who the server is authenticated as and what it is actually allowed to do: the issuing realm, the client, the acting user, token expiry, and the realm + 'realm-management' roles that govern admin access. The roles are read from the account's role mappings on the server, not from the token — Keycloak issues tokens with no role claims to some clients, so the token alone proves nothing. Call this FIRST when another tool returns 403.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description explains a non-obvious behavioral nuance: roles are read from server-side account role mappings rather than from the token, and tokens may contain no role claims for some clients. This is valuable context that prevents an agent from misinterpreting token contents as authoritative.

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 compact and information-dense, with no filler. Every sentence earns its place: the first defines what is shown, the second adds a critical caveat about role source, and the third gives a direct call-to-action. The most actionable instruction appears last but is short and memorable.

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

Completeness5/5

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

For a parameterless read-only diagnostic tool, the description covers output content, data origin, a caveat about token semantics, and a concrete trigger for use. Nothing an agent needs to decide when and why to call this tool is missing, and no output schema exists that would need to be summarized.

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?

The tool has zero parameters and the schema coverage is trivially 100%, so the description is not required to document parameter semantics. The baseline of 4 applies because there are no parameters to explain and the description does not need to compensate for any schema gaps.

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 precise purpose: show who the server is authenticated as and what it is allowed to do, listing concrete fields such as issuing realm, client, acting user, token expiry, and realm-management roles. This clearly distinguishes it from the broader sibling tools by focusing on identity and authorization context for the server's current credentials.

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 description gives a clear, actionable usage directive: 'Call this FIRST when another tool returns 403.' It does not enumerate exclusions or explicitly compare against keycloak_auth_status, but the scenario-based guidance is specific enough to tell an agent when to invoke this tool over others.

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