Skip to main content
Glama
shigechika

entraadm-mcp

by shigechika

signin_logs

Retrieves a user's recent sign-in events with AADSTS error meanings and status filtering to troubleshoot login failures.

Instructions

One user's recent sign-in events, AADSTS-annotated.

The most direct answer to "why can't this person log in": each entry's error_code_meaning translates the raw AADSTS code (e.g. 50126 -> "invalid credentials (wrong password)") so triage rarely needs a second lookup. result filters client-side after the Graph fetch (Graph cannot filter sign-ins on status/errorCode server-side): "failure" (the default) keeps only failed attempts, "success" keeps only clean ones, "all" keeps everything.

Because the filter is client-side, this walks pages until it has collected top matching entries or exhausts max_pages -- a mostly- successful user can otherwise mean paging through hundreds of rows to find a handful of failures. capped=true means the page budget ran out (or top was reached) before the whole window was scanned; a low match count alongside capped=true is evidence of "no more found within the budget", not "no more exist".

Read-only (AuditLog.Read.All application permission, or -- for azure-cli auth -- the Reports Reader directory role). Entra ID P1 retains sign-in logs for 30 days; hours beyond that returns an empty result, not an error.

Args: user: The account's userPrincipalName. hours: How far back to look, clamped to [1, 720] (30 days). result: "failure" (default), "success", or "all". top: Maximum matching entries to return, clamped to [1, 500]. max_pages: Page budget for the client-side filter walk (default: ENTRAADM_MAX_PAGES_DEFAULT). tenant: Search this tenant instead of the one claiming the UPN's domain (section name, domain or tenant id): for a .onmicrosoft.com or #EXT# UPN, or a B2B guest's sign-ins in the host tenant.

Input Schema

NameRequiredDescriptionDefault
topNo
userYes
hoursNo
resultNofailure
tenantNo
max_pagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.0
    • addedInput schema / properties / tenant
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tenant"
      +}
  2. First observedv0.1.0

TDQS

A4.7/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: read-only, required AuditLog.Read.All permission (or Reports Reader role for azure-cli), the 30-day P1 retention limit and the fact that out-of-range `hours` returns empty rather than erroring. It also discloses the non-obvious client-side filtering/paging behavior and the precise meaning of `capped=true` so a low match count isn't misread as 'no failures exist'.

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?

Front-loaded with the diagnostic payoff before any mechanics, and every paragraph adds information an agent needs. Minor redundancy: the client-side filtering rationale is restated twice ('filters client-side after the Graph fetch' then 'Because the filter is client-side'), costing a sentence.

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

Completeness5/5

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

No output schema exists, yet the description names the returned signals (`error_code_meaning`, `result`, `capped`) and explains each. Combined with permission requirements, retention limits and paging semantics, an agent has everything needed to call this correctly and interpret the response.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the Args section is the only documentation and it covers all six parameters with real meaning: `user` is a UPN, `hours` clamps to [1,720], `result` has three values with client-side filter semantics, `top` clamps to [1,500], `max_pages` defaults to an env var, and `tenant` explains the onmicrosoft.com/#EXT#/B2B-guest cases. This substantially exceeds what the bare schema conveys.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource+scope: 'One user's recent sign-in events, AADSTS-annotated', and frames the diagnostic question it answers ('why can't this person log in'). The explicit 'One user's' scoping separates it from the aggregate siblings signin_failure_stats / signin_success_stats / signin_by_ip without needing to name them.

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

Usage Guidelines4/5

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

'The most direct answer to "why can't this person log in"' gives clear situational context for when to reach for this tool, and the result/top semantics imply the exploratory-vs-targeted use cases. It stops short of naming when NOT to use it (e.g. fleet-wide failure counts belong in signin_failure_stats), so no explicit exclusion.

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