Skip to main content
Glama
mcp-keycloak

mcp-keycloak

by idoyudha

logout_user

Ends all active sessions for a specified user in a target Keycloak realm, revoking access when a user must be signed out everywhere.

Instructions

Logout all sessions for a user.

Args:
    user_id: The user's ID
    realm: Target realm (uses default if not specified)

Returns:
    Status message

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

Input Schema

NameRequiredDescriptionDefault
realmNo
user_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.3.0
    • addedOutput schema / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties
      Removed value: -{
      -  "result": {
      -    "additionalProperties": {
      -      "type": "string"
      -    },
      -    "title": "Result",
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "result"
      -]
    • changedOutput schema / title
      Previous value: -"logout_userOutput"New value: +"logout_userDictOutput"
  2. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It conveys that every session is terminated and that realm falls back to a default, but says nothing about required privileges, whether the action is reversible, or whether the caller's own session is affected.

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

Conciseness4/5

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

The core sentence is front-loaded and short, with zero preamble. The docstring-style Args/Returns block partially duplicates the schema and the existing output schema, which is mild waste.

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

Completeness3/5

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

An output schema exists, so omitting return-value detail is fine. For an unannotated destructive session-termination tool, however, the definition stops short of permissions, side effects, and sibling disambiguation.

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

Parameters3/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 carry the load; it does cover both parameters by name. Only the realm note ('uses default if not specified') adds real meaning, while 'The user's ID' merely restates the field title.

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?

States a specific verb and resource with scope ('Logout all sessions for a user'), which is more precise than a bare name restatement. It does not, however, distinguish itself from the sibling remove_all_user_sessions, which on its face covers the same operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'all sessions' phrasing implies when this is appropriate (bulk session termination for one user), but there is no explicit when-to-use, when-not-to-use, or named alternative. The absence of any routing against remove_all_user_sessions or get_user_sessions leaves selection to inference.

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