Skip to main content
Glama
Keycloak MCP Server

Keycloak MCP Server

by Cayetano97

get_client_offline_session_count

Returns the number of offline user sessions associated with a specified Keycloak client in a realm, helping administrators audit session usage and manage client access.

Instructions

Get application offline session count Returns a number of offline user sessions associated with this client { "count": number }.

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>",
      "client_uuid": "<client_uuid>"
    },
    "name": "get_client_offline_session_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
realmYesRealm name
client_uuidYesClient UUID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.2/5.0
Behavior3/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 does establish that this is a read-only lookup returning a single number, disclosed as { "count": number }. It says nothing about permissions required, whether disabled or expired offline sessions are included in the count, or any rate/limit behavior.

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?

It is short, but the opening clause reads like a pasted title fused into a sentence ('Get application offline session count Returns a number...') with no punctuation separating them, and the inline JSON snippet is unquoted. Brevity is undermined by sloppy structure.

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 two-required-parameter read that returns a scalar count, the description covers the essential contract, including the return shape that no output schema provides. Only edge details, such as what counts as an offline session, are missing, which is minor at this complexity.

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 100% (realm name, client UUID), so the schema already fully documents both parameters. The description adds only the notion that results are 'associated with this client', which restates client_uuid rather than adding new meaning.

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 (get) and a scoped resource: the count of offline user sessions associated with a client. That is distinct from the sibling get_client_session_count by the explicit 'offline' qualifier, although the description never names that sibling or states the contrast outright.

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 or when-not-to-use guidance, and no mention of the obvious alternative tools (get_client_session_count, list_client_offline_sessions). The agent must infer from the name alone that this is a counting-only variant versus a listing variant.

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