Skip to main content
Glama
shigechika

keycloak-mcp

by shigechika

get_login_stats_by_hour

Retrieve hourly login counts (local time) to analyze authentication trends and peak access times. Filter by date range to narrow the result window and prevent partial results.

Instructions

Get login statistics broken down by hour (local time).

Time-bounded: this call stops after KEYCLOAK_DEADLINE seconds (default 45) and returns what it has; the counts are then a lower bound. The result then starts with a "PARTIAL RESULT" warning. Call again with a narrower window instead of retrying the same call. A wide window on a busy day is what triggers it.

Args: date_from: Start date (YYYY-MM-DD). Defaults to last 24h when omitted (KEYCLOAK_DEFAULT_DATE_FROM_HOURS). date_to: End date (YYYY-MM-DD). Empty for all.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_toNo
date_fromNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses a hard deadline (KEYCLOAK_DEADLINE, default 45s), partial results with a 'PARTIAL RESULT' warning, counts being a lower bound, the trigger condition (wide window on a busy day), and the recommended recovery action. This is rich behavioral context that an agent needs to interpret results correctly.

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?

Front-loads the purpose, then adds a focused behavioral block, then an Args section. Every sentence earns its place, and the structure makes the critical timeout behavior easy to find.

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?

Given no annotations, an output schema (so return values need not be explained), and 0% schema description coverage, the description is nearly complete: it covers purpose, timeout behavior, and both parameters. The main gap is the absence of sibling-selection guidance, but for calling the tool correctly, an agent has what it needs.

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%, so the description must compensate. It does by documenting the date format (YYYY-MM-DD), the default for date_from (last 24h via KEYCLOAK_DEFAULT_DATE_FROM_HOURS), and the meaning of an empty date_to ('for all'). The only slight ambiguity is that 'Empty for all' could be clearer, but overall it supplies the missing parameter semantics.

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, resource, and granularity ('login statistics broken down by hour') that distinguishes it from the aggregate get_login_stats and the by-client variant. However, it does not explicitly name any sibling tool, so it relies on the agent to infer the difference from the name alone.

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?

Provides retry guidance for partial results ('call again with a narrower window'), but gives no guidance on when to use this tool versus alternatives like get_login_stats or get_login_stats_by_client. There is no explicit selection criteria or exclusion criteria.

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