Skip to main content
Glama
DynamicEndpoints

Microsoft 365 Core MCP Server

manage_intune_macos_compliance

Read-onlyIdempotent

Assess macOS device compliance status, generate reports on policy adherence, and manage security posture through Intune for Microsoft 365 environments.

Instructions

Assess macOS device compliance status and generate reports on policy adherence and security posture.

Input Schema

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

Implementation Reference

  • The core handler function that executes the manage_intune_macos_compliance tool. It handles various actions like retrieving compliance status, details, updating policies, and forcing evaluation using Microsoft Graph API calls to Intune endpoints.
    export async function handleIntuneMacOSCompliance(
      graphClient: Client,
      args: IntuneMacOSComplianceArgs
    ): Promise<{ content: { type: string; text: string }[] }> {
      let apiPath = '';
      let result: any;
    
      switch (args.action) {
        case 'get_status':
          if (args.deviceId) {
            // Get compliance status for specific device
            apiPath = `/deviceManagement/managedDevices/${args.deviceId}/deviceCompliancePolicyStates`;
          } else {
            // Get overall compliance status for macOS devices
            apiPath = '/deviceManagement/deviceCompliancePolicyDeviceStateSummary';
            apiPath += `?$filter=platformType eq 'macOS'`;
          }
          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');
          }
    
          // Get detailed compliance information for device
          apiPath = `/deviceManagement/managedDevices/${args.deviceId}/deviceCompliancePolicyStates`;
          const complianceStates = await graphClient.api(apiPath).get();
    
          // Get device configuration states
          const configApiPath = `/deviceManagement/managedDevices/${args.deviceId}/deviceConfigurationStates`;
          const configStates = await graphClient.api(configApiPath).get();
    
          result = {
            deviceId: args.deviceId,
            compliancePolicyStates: complianceStates,
            configurationStates: configStates
          };
          break;
    
        case 'update_policy':
          if (!args.policyId) {
            throw new McpError(ErrorCode.InvalidParams, 'policyId is required for update_policy action');
          }
    
          apiPath = `/deviceManagement/deviceCompliancePolicies/${args.policyId}`;
          const updatePayload = {
            passwordRequired: args.complianceData?.passwordCompliant,
            storageRequireEncryption: args.complianceData?.encryptionCompliant,
            systemIntegrityProtectionEnabled: args.complianceData?.systemIntegrityCompliant,
            firewallEnabled: args.complianceData?.firewallCompliant
          };
    
          result = await graphClient.api(apiPath).patch(updatePayload);
          break;
    
        case 'force_evaluation':
          if (!args.deviceId) {
            throw new McpError(ErrorCode.InvalidParams, 'deviceId is required for force_evaluation action');
          }
    
          // Trigger compliance evaluation on device
          apiPath = `/deviceManagement/managedDevices/${args.deviceId}/syncDevice`;
          await graphClient.api(apiPath).post({});
    
          // Also trigger compliance policy evaluation
          const evalApiPath = `/deviceManagement/managedDevices/${args.deviceId}/triggerConfigurationManagerAction`;
          await graphClient.api(evalApiPath).post({
            action: {
              actionType: 'evaluateCompliance'
            }
          });
    
          result = { message: 'Compliance evaluation triggered successfully' };
          break;
    
        default:
          throw new McpError(ErrorCode.InvalidParams, `Invalid action: ${args.action}`);
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • TypeScript interface defining the input parameters for the tool handler, including action types and optional compliance data fields.
    export interface IntuneMacOSComplianceArgs {
      action: 'get_status' | 'get_details' | 'update_policy' | 'force_evaluation';
      deviceId?: string;
      policyId?: string;
      complianceData?: {
        passwordCompliant?: boolean;
        encryptionCompliant?: boolean;
        osVersionCompliant?: boolean;
        threatProtectionCompliant?: boolean;
        systemIntegrityCompliant?: boolean;
        firewallCompliant?: boolean;
        gatekeeperCompliant?: boolean;
        jailbrokenCompliant?: boolean;
      };
    }
  • src/handlers.ts:32-44 (registration)
    Imports the handler function and its argument type into the main handlers file, enabling registration and use of the tool in the MCP server.
    // Import Intune macOS handlers and types
    import {
      handleIntuneMacOSDevices,
      handleIntuneMacOSPolicies,
      handleIntuneMacOSApps,
      handleIntuneMacOSCompliance
    } from './handlers/intune-macos-handler.js';
    import {
      IntuneMacOSDeviceArgs,
      IntuneMacOSPolicyArgs,
      IntuneMacOSAppArgs,
      IntuneMacOSComplianceArgs
    } from './types/intune-types.js';
  • Tool metadata registration providing description, title, and annotations (read-only hint, etc.) for the manage_intune_macos_compliance tool.
    manage_intune_macos_compliance: {
      description: "Assess macOS device compliance status and generate reports on policy adherence and security posture.",
      title: "Intune macOS Compliance Checker",
      annotations: { title: "Intune macOS Compliance Checker", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
    },
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 context about generating reports and assessing compliance status, which is useful but doesn't disclose additional behavioral traits like rate limits, authentication needs, or what specific data is returned. 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 with zero waste. It front-loads key actions ('assess', 'generate reports') and resources, making it easy to parse. Every word contributes to understanding the tool's purpose without redundancy.

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?

For a tool with 4 parameters, 100% schema coverage, and annotations covering safety, the description is minimally adequate. It lacks output schema, so return values aren't explained, and it doesn't address usage context or sibling differentiation. Given the complexity, it should provide more guidance on when to use this versus related tools.

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%, so the schema fully documents all parameters. The description implies actions like 'assess' and 'generate reports', which map to the 'action' parameter's enum values, but adds no syntax, format, or interaction details beyond what the schema provides. Baseline 3 is appropriate given high schema coverage.

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 with specific verbs ('assess', 'generate reports') and resources ('macOS device compliance status', 'policy adherence and security posture'). It distinguishes itself from general compliance tools by specifying macOS focus, though it doesn't explicitly differentiate from sibling tools like 'manage_intune_macos_devices' or 'manage_intune_windows_compliance'.

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 sibling tools like 'manage_intune_macos_devices' or 'manage_intune_windows_compliance', nor does it specify prerequisites, exclusions, or appropriate contexts for use. The agent must infer usage from the description alone.

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