Skip to main content
Glama
DynamicEndpoints

Microsoft 365 Core MCP Server

manage_intune_windows_compliance

Read-onlyIdempotent

Assess and manage Windows device compliance in Intune by checking BitLocker encryption, antivirus status, and security configurations to ensure devices meet organizational policies.

Instructions

Assess Windows device compliance status including BitLocker encryption, antivirus status, and security configurations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesIntune Windows compliance action
deviceIdNoDevice ID for compliance assessment
complianceTypeNoType of compliance check
policiesNoSpecific policy IDs to assess
complianceDataNoCompliance assessment data

Implementation Reference

  • Main execution logic for the manage_intune_windows_compliance tool. Handles compliance status checks, details retrieval, policy updates, force evaluations, and BitLocker key retrieval using Microsoft Graph API endpoints.
    export async function handleIntuneWindowsCompliance(
      graphClient: Client,
      args: IntuneWindowsComplianceArgs
    ): Promise<{ content: { type: string; text: string }[] }> {
      let apiPath = '';
      let result: any;
    
      switch (args.action) {
        case 'get_status':
          if (args.deviceId) {
            apiPath = `/deviceManagement/managedDevices/${args.deviceId}/deviceCompliancePolicyStates`;
          } else {
            apiPath = '/deviceManagement/deviceCompliancePolicyDeviceStateSummary';
          }
          result = await graphClient.api(apiPath).get();
          break;
    
        case 'get_details':
          if (!args.deviceId) {
            throw new McpError(ErrorCode.InvalidParams, 'deviceId is required for get_details action');
          }
          
          if (args.complianceType === 'bitlocker') {
            apiPath = `/informationProtection/bitlocker/recoveryKeys`;
            const filter = `$filter=deviceId eq '${args.deviceId}'`;
            result = await graphClient.api(`${apiPath}?${filter}`).get();
          } else {
            apiPath = `/deviceManagement/managedDevices/${args.deviceId}/deviceConfigurationStates`;
            if (args.policies && args.policies.length > 0) {
              const policyFilter = args.policies.map(p => `id eq '${p}'`).join(' or ');
              apiPath += `?$filter=${policyFilter}`;
            }
            result = await graphClient.api(apiPath).get();
          }
          break;
    
        case 'update_policy':
          if (!args.policies || args.policies.length === 0) {
            throw new McpError(ErrorCode.InvalidParams, 'policies array is required for update_policy action');
          }
    
          const updateResults = [];
          for (const policyId of args.policies) {
            try {
              apiPath = `/deviceManagement/deviceCompliancePolicies/${policyId}`;
              const policy = await graphClient.api(apiPath).get();
              
              // Force policy refresh
              const refreshPath = `/deviceManagement/deviceCompliancePolicies/${policyId}/scheduleActionsForRules`;
              await graphClient.api(refreshPath).post({
                deviceCompliancePolicyId: policyId
              });
              
              updateResults.push({
                policyId: policyId,
                status: 'updated',
                name: policy.displayName
              });
            } catch (error) {
              updateResults.push({
                policyId: policyId,
                status: 'failed',
                error: error instanceof Error ? error.message : 'Unknown error'
              });
            }
          }
          
          result = { updatedPolicies: updateResults };
          break;
    
        case 'force_evaluation':
          if (!args.deviceId) {
            throw new McpError(ErrorCode.InvalidParams, 'deviceId is required for force_evaluation action');
          }
    
          // Trigger compliance evaluation
          apiPath = `/deviceManagement/managedDevices/${args.deviceId}/syncDevice`;
          await graphClient.api(apiPath).post({});
          
          // Also trigger policy refresh
          const refreshPath = `/deviceManagement/managedDevices/${args.deviceId}/refreshDeviceComplianceReportSummarization`;
          result = await graphClient.api(refreshPath).post({});
          break;
    
        case 'get_bitlocker_keys':
          if (!args.deviceId) {
            throw new McpError(ErrorCode.InvalidParams, 'deviceId is required for get_bitlocker_keys action');
          }
          
          apiPath = `/informationProtection/bitlocker/recoveryKeys`;
          const filter = `$filter=deviceId eq '${args.deviceId}'`;
          result = await graphClient.api(`${apiPath}?${filter}`).get();
          break;
    
        default:
          throw new McpError(ErrorCode.InvalidParams, `Unknown action: ${args.action}`);
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `Windows Compliance Management Result:\n${JSON.stringify(result, null, 2)}`
          }
        ]
      };
    }
  • Input schema (TypeScript interface) defining parameters for the tool handler, including action types and optional fields like deviceId, complianceType, and policies.
    export interface IntuneWindowsComplianceArgs {
      action: 'get_status' | 'get_details' | 'update_policy' | 'force_evaluation' | 'get_bitlocker_keys';
      deviceId?: string;
      complianceType?: 'security' | 'configuration' | 'update' | 'bitlocker';
      policies?: string[];
      complianceData?: {
        passwordCompliant?: boolean;
        encryptionCompliant?: boolean;
        osVersionCompliant?: boolean;
        threatProtectionCompliant?: boolean;
        bitlockerCompliant?: boolean;
        firewallCompliant?: boolean;
        antivirusCompliant?: boolean;
      };
    }
  • Tool metadata registration with description, title, and annotations (read-only, idempotent) for the manage_intune_windows_compliance tool.
    manage_intune_windows_compliance: {
      description: "Assess Windows device compliance status including BitLocker encryption, antivirus status, and security configurations.",
      title: "Intune Windows Compliance Checker",
      annotations: { title: "Intune Windows Compliance Checker", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
  • Imports policy templates and validation helpers used within the compliance handler for settings catalog and PPC policies.
    import {
      SETTINGS_CATALOG_POLICY_TEMPLATES,
      PPC_POLICY_TEMPLATES,
      validateSettingsCatalogPolicy,
      validatePPCPolicy,
      SettingsCatalogPolicy,
      PPCPolicyConfig
    } from './intune-policy-templates.js';
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering safety and idempotency. The description adds some context by implying assessment (non-destructive) and listing specific compliance aspects like BitLocker and antivirus, but doesn't disclose rate limits, authentication needs, or detailed behavioral traits beyond what annotations provide. No contradiction with annotations exists.

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 that front-loads the core purpose without unnecessary words. It directly states what the tool does, making it easy to parse and understand quickly. Every part of the sentence contributes to clarifying the tool's function.

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

Completeness3/5

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

Given the complexity (5 parameters, nested objects) and rich annotations (readOnly, idempotent, non-destructive), the description is minimally adequate. It covers the assessment purpose but lacks details on output format, error handling, or specific use cases. Without an output schema, more guidance on return values would be helpful, but the annotations provide a safety net.

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%, with all parameters well-documented in the schema itself. The description mentions 'BitLocker encryption, antivirus status, and security configurations,' which loosely maps to complianceType and complianceData fields, but doesn't add significant meaning beyond the schema's detailed descriptions and enums. Baseline 3 is appropriate as the schema does the heavy lifting.

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 tool's purpose: 'Assess Windows device compliance status including BitLocker encryption, antivirus status, and security configurations.' It specifies the verb 'assess' and the resource 'Windows device compliance status' with concrete examples. However, it doesn't explicitly differentiate from sibling tools like 'manage_intune_macos_compliance' or 'manage_compliance_assessments', which would be needed for a perfect score.

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, specific contexts, or exclusions. For example, it doesn't clarify if this is for real-time monitoring vs. historical assessment, or how it differs from other compliance tools in the sibling list, leaving the agent with no usage direction.

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/DynamicEndpoints/m365-core-mcp'

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