Skip to main content
Glama
DynamicEndpoints

BOD-25-01-CSA-Microsoft-Policy-MCP

configure_role_alerts

Set up email notifications for privileged role assignments to monitor access changes in Microsoft 365 services.

Instructions

Configure alerts for privileged role assignments (MS.AAD.7.7v1)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notificationEmailsYesEmail addresses to notify on role assignments

Implementation Reference

  • The main handler function that executes the tool logic: configures privileged role assignment alerts by posting to Microsoft Graph API /policies/alertPolicies with provided notification emails.
    private async configureRoleAlerts(args: AlertSettingsArgs) {
      try {
        // Configure role assignment alerts using Microsoft Graph API
        await this.graphClient
          .api('/policies/alertPolicies')
          .post({
            displayName: 'Privileged Role Assignment Alert',
            isEnabled: true,
            severity: 'high',
            category: 'roleManagement',
            notificationRecipients: args.notificationEmails,
          });
    
        return {
          content: [
            {
              type: 'text',
              text: 'Privileged role assignment alerts configured successfully',
            },
          ],
        };
      } catch (error: unknown) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to configure role alerts: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Type definition (AlertSettingsArgs) and validation function (isAlertSettingsArgs) for the tool's input parameters: array of notification email strings.
    interface AlertSettingsArgs {
      notificationEmails: string[];
    }
    
    function isRoleAssignmentArgs(args: unknown): args is RoleAssignmentArgs {
      if (typeof args !== 'object' || args === null) return false;
      const a = args as Record<string, unknown>;
      return (
        Array.isArray(a.userIds) &&
        a.userIds.every(id => typeof id === 'string') &&
        typeof a.roleId === 'string'
      );
    }
    
    function isAlertSettingsArgs(args: unknown): args is AlertSettingsArgs {
      if (typeof args !== 'object' || args === null) return false;
      const a = args as Record<string, unknown>;
      return (
        Array.isArray(a.notificationEmails) &&
        a.notificationEmails.every(email => typeof email === 'string')
      );
    }
  • Tool registration in the ListToolsRequestHandler, including name, description, and inputSchema.
      name: 'configure_role_alerts',
      description: 'Configure alerts for privileged role assignments (MS.AAD.7.7v1)',
      inputSchema: {
        type: 'object',
        properties: {
          notificationEmails: {
            type: 'array',
            items: {
              type: 'string',
            },
            description: 'Email addresses to notify on role assignments',
          },
        },
        required: ['notificationEmails'],
      },
    },
  • Dispatch case in CallToolRequestHandler that validates input and calls the handler function.
    case 'configure_role_alerts': {
      if (!isAlertSettingsArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid alert settings arguments'
        );
      }
      return await this.configureRoleAlerts(request.params.arguments);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions configuring alerts but does not specify whether this is a read-only or mutative operation, what permissions are required, how alerts are delivered (e.g., email frequency), or any side effects like overwriting existing settings. This leaves significant gaps in understanding the tool's behavior.

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 directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly, which is ideal for conciseness.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely involves configuration changes. It does not cover behavioral aspects like mutability, permissions, or response format, which are critical for an agent to use it correctly in a security or compliance context.

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?

The input schema has 100% description coverage, with the parameter 'notificationEmails' clearly documented as 'Email addresses to notify on role assignments'. The description does not add any additional semantic context beyond this, such as email format requirements or limits, so it meets the baseline of 3 where the schema handles 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 action ('Configure alerts') and target resource ('privileged role assignments'), with a specific reference to 'MS.AAD.7.7v1' indicating a compliance or security standard. However, it does not explicitly differentiate from sibling tools like 'configure_admin_alerts' or 'configure_admin_consent', which limits the score to 4 rather than 5.

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, such as 'configure_admin_alerts' or other alert-related tools in the sibling list. It lacks context about prerequisites, timing, or exclusions, leaving the agent with minimal 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/Automated-BOD-25-01-CISA-Microsoft-Policies-MCP'

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