Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

entra_id_list_users

Retrieve user accounts from Entra ID (Azure AD) using Microsoft Graph API to manage and monitor identity data for security analysis.

Instructions

List users in Entra ID (Azure AD) via Microsoft Graph API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The EntraIDListUsersTool class defines the tool name, description, and implements the core logic in the async run method. It checks Graph permissions, fetches users from Microsoft Graph API /users endpoint using GraphApiClient, paginates results, and handles 403 errors specifically.
    class EntraIDListUsersTool(EntraIDToolBase):
        """
        Tool to list users in Entra ID (Azure AD) via Microsoft Graph API.
        """
    
        name = "entra_id_list_users"
        description = "List users in Entra ID (Azure AD) via Microsoft Graph API."
    
        async def run(self, ctx: Context, **kwargs):
            self.check_graph_permissions()
            client = GraphApiClient()
            url = f"{GRAPH_API_BASE}/users"
            try:
    
                def fetch():
                    users = []
                    for page in client.call_azure_rest_api("GET", url):
                        users.extend(page.get("value", []))
                    return users
    
                return await run_in_thread(fetch, name="entra_id_list_users")
            except requests.HTTPError as e:
                if e.response.status_code == 403:
                    raise Exception("Permission denied: User.Read.All is required.") from e
                raise
  • The register_tools function registers the EntraIDListUsersTool (and other Entra ID tools) with the MCP server instance via the class register method.
    def register_tools(mcp):
        """
        Register all Entra ID tools with the MCP server instance.
    
        Args:
            mcp: The MCP server instance.
        """
        EntraIDListUsersTool.register(mcp)
        EntraIDGetUserTool.register(mcp)
        EntraIDListGroupsTool.register(mcp)
        EntraIDGetGroupTool.register(mcp)
  • The EntraIDToolBase class provides shared functionality for Entra ID tools, including check_graph_permissions method which verifies required Microsoft Graph permissions before tool execution.
    class EntraIDToolBase(MCPToolBase):
        """
        Base class for Entra ID tools with permission checking.
        Uses utilities.graph_api_utils for Graph API access and permission checks.
        """
    
        def check_graph_permissions(self) -> None:
            """
            Checks if the current identity has required Microsoft Graph permissions using the utility.
            Raises:
                Exception: If required permissions are missing.
            """
            client = GraphApiClient()
            token = client.get_token()
            check_graph_permissions(token)
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic action without any details on traits like read-only vs. destructive (implied read-only but not confirmed), rate limits, authentication needs, output format, pagination, or error handling. This is inadequate for a tool with zero annotation coverage.

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to scan. Every element ('List users', 'Entra ID', 'Microsoft Graph API') adds value without redundancy.

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

Completeness1/5

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

Given the complexity (API integration tool), lack of annotations, 0% schema coverage, and no output schema, the description is severely incomplete. It omits critical context like parameter usage, behavioral traits, authentication, and output details. This leaves the agent with insufficient information to use the tool effectively.

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

Parameters1/5

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

The input schema has 1 parameter ('kwargs') with 0% description coverage, and the tool description provides no information about parameters. It doesn't explain what 'kwargs' represents (e.g., query filters, pagination options) or how to use it. With low schema coverage, the description fails to compensate, leaving parameters undocumented.

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 clearly states the action ('List users') and resource ('in Entra ID (Azure AD)'), and specifies the API used ('via Microsoft Graph API'). It distinguishes from siblings like 'entra_id_get_user' (single user retrieval) and 'entra_id_list_groups' (different resource type), though it doesn't explicitly contrast them. The purpose is specific and unambiguous.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication requirements), when to choose this over 'entra_id_get_user' for single users, or any limitations (e.g., pagination, filtering capabilities). Usage context is implied by the name but not articulated.

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/dstreefkerk/ms-sentinel-mcp-server'

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