Skip to main content
Glama
intune-handler.ts1.13 kB
import { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js'; import { Client } from '@microsoft/microsoft-graph-client'; import { handleIntuneMacOSPolicies } from './intune-macos-handler.js'; import { handleIntuneWindowsPolicies } from './intune-windows-handler.js'; export async function handleCreateIntunePolicy(graphClient: Client, args: any): Promise<any> { const { platform, policyType, displayName, description, settings, assignments } = args; if (!platform || !policyType || !displayName || !settings) { throw new McpError(ErrorCode.InvalidParams, 'Missing required parameters.'); } const policyArgs = { action: 'create', policyType: policyType, name: displayName, description: description, settings: settings, assignments: assignments }; if (platform === 'macos') { return await handleIntuneMacOSPolicies(graphClient, policyArgs as any); } else if (platform === 'windows') { return await handleIntuneWindowsPolicies(graphClient, policyArgs as any); } else { throw new McpError(ErrorCode.InvalidParams, `Unsupported platform: ${platform}`); } }

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