Skip to main content
Glama
Keycloak MCP Server

Keycloak MCP Server

by Cayetano97

delete_realm_session

Remove a specific user session from a Keycloak realm by session ID, with optional handling for offline sessions. Use it to revoke or clean up active or offline user sessions.

Instructions

Remove a specific user session.

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": {
      "realm": "<realm>",
      "session": "<session>"
    },
    "name": "delete_realm_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
realmYesRealm name
sessionYesUser session ID
isOfflineNoWhether the session is an offline session

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full burden and it discloses almost nothing: not that the deletion is irreversible, not whether it terminates an active login immediately, not what permissions are needed, and not what happens when the session does not exist. "Remove" implies mutation but the consequences are left entirely unstated.

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?

A single short sentence with the action front-loaded and no filler. It is efficient, though the brevity reflects under-specification rather than disciplined editing.

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?

This is a destructive mutation with no annotations and no output schema, so the description is the only place to learn about reversibility, side effects, and failure modes — and it covers none of them. For a three-parameter delete operation it is materially under-described.

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 coverage is 100%, with realm, session, and isOffline each documented inline, so the schema does the parameter work. The description only reinforces that the session is a single specific one and says nothing about the isOffline distinction, which is the one parameter where extra meaning would have helped.

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 names a specific verb ("Remove") and a specific resource ("user session"), so an agent can tell it deletes one session rather than a realm, client, or role like the sibling delete_* tools. It stops short of explicitly contrasting itself with any sibling, so it is clear but not differentiated.

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?

There is no when-to-use guidance, no prerequisites, and no statement about what to do instead if the goal is to revoke all sessions or handle offline sessions. The word "specific" hints that a session ID is required, but the agent must infer everything else.

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

Deploy Server

Other Tools