Skip to main content
Glama
shigechika

entraadm-mcp

by shigechika

directory_audits

Retrieve directory audit logs to see who performed admin actions on user objects, enabling triage to distinguish human-handled incidents from unresolved ones.

Instructions

Who did what to the directory, and when -- the operator-side counterpart to signin_logs.

Every admin action against a user object (block/unblock, password reset, role assignment, attribute edits) appears here, naming the actor (initiated_by) and the affected object(s) (target_resources). This is the record a manual "unblock and reset" intervention -- like the one that closed the 2026-08-21 case this server exists to shorten -- leaves behind; it is how a later triage can tell "already handled by a human" from "still open".

user, when given, matches audits where that account is either the initiator or a target resource. Graph's directoryAudits endpoint only supports server-side $filter on the initiator (initiatedBy/user/userPrincipalName), not on targetResources, so this fetches the full time window and matches both sides client-side -- a window with many unrelated admin actions can need a larger max_pages budget than signin_logs/signin_failure_stats to find one specific user's audits; capped=true warns when that budget ran out before the window was fully scanned.

Read-only (AuditLog.Read.All application permission, or -- for azure-cli auth -- the Reports Reader directory role). Entra ID retains directory audit logs for 30 days, same as sign-in logs.

Args: user: Restrict to audits naming this userPrincipalName as actor or target (default: all). hours: How far back to look, clamped to [1, 720] (30 days). top: Maximum records to return, clamped to [1, 500]. max_pages: Page budget (default: ENTRAADM_MAX_PAGES_DEFAULT).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
userNo
hoursNo
max_pagesNo
Behavior5/5

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

With no annotations, the description carries the full burden. It discloses read-only status, required permissions (AuditLog.Read.All, Reports Reader), retention (30 days), and critically explains client-side filtering for targetResources—including the consequence for max_pages budgeting and the capped=true warning. This is thorough and actionable.

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 description is longer than typical but every sentence earns its place—purpose, example, technical caveat, permissions, retention, and parameter docs. It's front-loaded with the central question, and the structure (overview, rationale, behavior, args) is logical and scannable. Slight verbosity in the anecdote, but not wasteful.

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?

For a tool with 4 parameters, no output schema, and no annotations, the description covers purpose, usage, permissions, pagination behavior, retention, and parameter semantics. It also anticipates edge cases (capped=true, larger max_pages). The only minor gap is an explicit return format, but the description already implies the audit fields (initiated_by, target_resources).

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%, but the Args section explains each parameter's meaning, default, and clamp ranges (hours [1,720], top [1,500], max_pages budget). It also clarifies the semantic nuance of 'user' (actor or target). This fully compensates for the schema's lack of descriptions.

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?

The description clearly states the resource (directory audits), the core function (who did what to the directory), and distinguishes it from signin_logs as the operator-side counterpart. It even provides a concrete scenario (manual unblock and reset) that clarifies its unique role. This fully differentiates it from siblings.

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

Usage Guidelines5/5

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

Explicitly ties usage to a specific triage need (distinguishing 'handled by human' from 'still open'), names the alternative (signin_logs) and contrasts behavior (full-window fetch vs server-side filtering). It also gives operational advice about max_pages requirements, making when-to-use and when-not-to-use precise.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shigechika/entraadm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server