Skip to main content
Glama
keycloak-mcp

keycloak-mcp

by shigechika

logout_user

Force logout a user by removing all their active sessions.

Instructions

Force logout a user by removing all their active sessions.

Each probe opens its own connection, lists the user's sessions and logs the user out on the node it reached when that node lists a session. Until one logout has gone through it is sent even when the node lists nothing: it also sets the user's notBefore in the database, so tokens issued before it are rejected by every node. Probing goes on until no session is seen on KEYCLOAK_LOGOUT_CLEAN_PROBES probes in a row (default 10), at most KEYCLOAK_LOGOUT_MAX_PROBES (default 40), so that nodes that do not share sessions behind a load balancer are all reached. The resulting notBefore is reported. The whole run is bounded by KEYCLOAK_DEADLINE; when it runs out or a request fails, the result says verification is incomplete, with what was done so far.

Args: username: Exact username (email).

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": {
      "username": "<username>"
    },
    "name": "logout_user"
  }
}

Input Schema

NameRequiredDescriptionDefault
usernameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.14.1
  2. Removedv0.13.1
  3. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses key side effects: session removal, setting notBefore so older tokens are rejected, multi-node probing, bounded retry behavior, and incomplete verification on timeout or failure. It does not mention required permissions or any additional operational constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, but the rest is dense and includes implementation-level detail such as environment variable names and probe semantics. Much of it is useful, but it is longer and more procedural than necessary for an agent-facing tool description.

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?

An output schema exists, so return-value structure need not be explained, and the description still explains the important result condition of incomplete verification. It covers the core behavior well, though it omits auth requirements and some operational expectations.

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 description coverage is 0%, but the description compensates for the single required parameter by saying it is an exact username in email form. That adds useful meaning beyond the bare schema type.

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 states a specific verb and resource: force logout a user by removing all active sessions. It is clear, but it does not explicitly distinguish this tool from related siblings such as reset_password or set_user_enabled.

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 explains mechanics rather than when to use this tool versus alternatives. There is no explicit guidance on prerequisites, exclusions, or when a narrower session-management tool should be preferred.

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