Skip to main content
Glama
DynamicEndpoints

Microsoft 365 Core MCP Server

manage_dlp_incidents

Investigate and manage Data Loss Prevention policy violations and incidents, including user notifications and remediation actions for Microsoft 365 security compliance.

Instructions

Investigate and manage DLP policy violations and incidents including user notifications and remediation actions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesDLP incident management action
incidentIdNoDLP incident ID
dateRangeNoDate range filter
severityNoIncident severity
statusNoIncident status
policyIdNoAssociated policy ID

Implementation Reference

  • Core handler function implementing manage_dlp_incidents tool logic. Handles actions: list (filter by date/severity), get, resolve, escalate DLP incidents via Microsoft Graph /security/alerts_v2 API.
    export async function handleDLPIncidents(
      graphClient: Client,
      args: DLPIncidentArgs
    ): Promise<{ content: { type: string; text: string }[] }> {
      let apiPath = '';
      let result: any;
    
      switch (args.action) {
        case 'list':
          // List DLP incidents from security events
          apiPath = '/security/alerts_v2';
          const filterConditions: string[] = [];
          
          if (args.dateRange) {
            filterConditions.push(`createdDateTime ge ${args.dateRange.startDate} and createdDateTime le ${args.dateRange.endDate}`);
          }
          
          if (args.severity) {
            filterConditions.push(`severity eq '${args.severity}'`);
          }
    
          if (filterConditions.length > 0) {
            apiPath += `?$filter=${filterConditions.join(' and ')}`;
          }
    
          result = await graphClient.api(apiPath).get();
          break;
    
        case 'get':
          if (!args.incidentId) {
            throw new McpError(ErrorCode.InvalidParams, 'incidentId is required for get action');
          }
          apiPath = `/security/alerts_v2/${args.incidentId}`;
          result = await graphClient.api(apiPath).get();
          break;
    
        case 'resolve':
          if (!args.incidentId) {
            throw new McpError(ErrorCode.InvalidParams, 'incidentId is required for resolve action');
          }
          apiPath = `/security/alerts_v2/${args.incidentId}`;
          result = await graphClient.api(apiPath).patch({
            status: 'resolved',
            feedback: 'truePositive'
          });
          break;
    
        case 'escalate':
          if (!args.incidentId) {
            throw new McpError(ErrorCode.InvalidParams, 'incidentId is required for escalate action');
          }
          apiPath = `/security/alerts_v2/${args.incidentId}`;
          result = await graphClient.api(apiPath).patch({
            severity: 'high',
            classification: 'truePositive'
          });
          break;
    
        default:
          throw new McpError(ErrorCode.InvalidParams, `Invalid action: ${args.action}`);
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Zod input schema for manage_dlp_incidents tool, defining parameters for actions like list, get, resolve, escalate with filters for date range, severity, status.
    export const dlpIncidentSchema = z.object({
      action: z.enum(['list', 'get', 'resolve', 'escalate']).describe('DLP incident management action'),
      incidentId: z.string().optional().describe('DLP incident ID'),
      dateRange: z.object({
        startDate: z.string().describe('Start date'),
        endDate: z.string().describe('End date'),
      }).optional().describe('Date range filter'),
      severity: z.enum(['Low', 'Medium', 'High', 'Critical']).optional().describe('Incident severity'),
      status: z.enum(['Active', 'Resolved', 'InProgress', 'Dismissed']).optional().describe('Incident status'),
      policyId: z.string().optional().describe('Associated policy ID'),
    });
  • src/server.ts:701-719 (registration)
    MCP server registration of manage_dlp_incidents tool, associating the schema with handleDLPIncidents handler, including metadata annotations.
      "manage_dlp_incidents",
      "Investigate and manage DLP policy violations and incidents including user notifications and remediation actions.",
      dlpIncidentSchema.shape,
      {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false},
      wrapToolHandler(async (args: DLPIncidentArgs) => {
        this.validateCredentials();
        try {
          return await handleDLPIncidents(this.getGraphClient(), args);
        } catch (error) {
          if (error instanceof McpError) {
            throw error;
          }
          throw new McpError(
            ErrorCode.InternalError,
            `Error executing tool: ${error instanceof Error ? error.message : 'Unknown error'}`
          );
        }
      })
    );
  • TypeScript interface DLPIncidentArgs defining input types for the DLP incidents handler, matching the Zod schema.
    export interface DLPIncidentArgs {
      action: 'list' | 'get' | 'resolve' | 'escalate';
      incidentId?: string;
      dateRange?: { 
        startDate: string; 
        endDate: string; 
      };
      severity?: 'Low' | 'Medium' | 'High' | 'Critical';
      status?: 'Active' | 'Resolved' | 'InProgress' | 'Dismissed';
      policyId?: string;
    }
  • Tool metadata for manage_dlp_incidents providing description, title 'DLP Incident Manager', and annotations used in MCP tool discovery and UI hints.
    manage_dlp_incidents: {
      description: "Investigate and manage DLP policy violations and incidents including user notifications and remediation actions.",
      title: "DLP Incident Manager",
      annotations: { title: "DLP Incident Manager", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, and destructiveHint=false, indicating this is a mutable, non-idempotent, non-destructive operation. The description adds context about 'remediation actions' and 'user notifications' that suggests behavioral aspects beyond the annotations, but doesn't detail side effects, permissions needed, or rate limits. 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.

Conciseness4/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. It avoids redundancy and wastes no words, though it could be slightly more structured by separating investigation from management aspects. Every phrase adds value, making it appropriately concise for a multi-action tool.

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 tool's complexity (6 parameters, mutable actions, no output schema) and rich annotations, the description is adequate but incomplete. It covers the high-level purpose but lacks details on return values, error handling, or action-specific behaviors (e.g., what 'resolve' entails). With no output schema, more context on expected results would improve completeness.

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%, providing full documentation of all 6 parameters. The description adds no specific parameter semantics beyond implying the tool handles incidents, which aligns with parameters like 'incidentId' and 'action'. It doesn't explain how parameters interact (e.g., 'dateRange' with 'action=list') or add usage examples, so it meets the baseline for 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 ('investigate and manage') and resources ('DLP policy violations and incidents'), including scope ('user notifications and remediation actions'). It distinguishes from some siblings like 'manage_dlp_policies' by focusing on incidents rather than policies, though it doesn't explicitly differentiate from all potential alternatives.

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, when-not-to-use scenarios, or compare it to sibling tools like 'manage_alerts' or 'search_audit_log' that might overlap with incident investigation. Usage is implied through the action parameter but not explicitly stated.

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