Skip to main content
Glama
DynamicEndpoints

Microsoft 365 Core MCP Server

manage_evidence_collection

Read-onlyIdempotent

Collect and preserve compliance evidence such as audit logs, configuration snapshots, and attestation records from Microsoft 365 services.

Instructions

Collect and preserve compliance evidence including audit logs, configuration snapshots, and attestation records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesEvidence collection action
evidenceTypeNoType of evidence to collect
timeRangeNoTime range for evidence collection
systemsNoSpecific systems to collect evidence from

Implementation Reference

  • Main handler function that executes the manage_evidence_collection tool logic. Handles actions like collect, schedule, get_status, and download evidence using a switch statement on args.action.
    export async function handleEvidenceCollection(
      graphClient: Client,
      args: EvidenceCollectionArgs
    ): Promise<{ content: { type: string; text: string }[] }> {
      let result: any;
    
      switch (args.action) {
        case 'collect':
          // Start evidence collection
          const collectionId = `collection-${Date.now()}`;
          result = await startEvidenceCollection(graphClient, collectionId, args);
          break;
    
        case 'schedule':
          result = {
            collectionId: args.collectionId,
            scheduledTime: args.settings?.scheduledTime,
            status: 'scheduled',
            message: 'Evidence collection scheduled successfully'
          };
          break;
    
        case 'get_status':
          if (!args.collectionId) {
            throw new McpError(ErrorCode.InvalidParams, 'collectionId is required for get_status action');
          }
          
          result = await getCollectionStatus(args.collectionId);
          break;
    
        case 'download':
          if (!args.collectionId) {
            throw new McpError(ErrorCode.InvalidParams, 'collectionId is required for download action');
          }
          
          result = await downloadEvidence(args.collectionId);
          break;
    
        default:
          throw new McpError(ErrorCode.InvalidParams, `Invalid action: ${args.action}`);
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • src/server.ts:964-983 (registration)
    MCP server tool registration for 'manage_evidence_collection'. Registers the handler with schema, metadata annotations, and error handling wrapper.
    this.server.tool(
      "manage_evidence_collection",
      "Collect and preserve compliance evidence including audit logs, configuration snapshots, and attestation records.",
      evidenceCollectionSchema.shape,
      {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true},
      wrapToolHandler(async (args: EvidenceCollectionArgs) => {
        this.validateCredentials();
        try {
          return await handleEvidenceCollection(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'}`
          );
        }
      })
    );
  • Zod schema definition for the tool input parameters (EvidenceCollectionArgs), used in MCP registration for validation.
    export const evidenceCollectionSchema = z.object({
      action: z.enum(['get_status', 'schedule', 'collect', 'download']).describe('Evidence collection action'),
      evidenceType: z.enum(['configuration', 'logs', 'policies', 'certificates', 'reports']).optional().describe('Type of evidence to collect'),
      timeRange: z.object({
        start: z.string().describe('Start date (ISO format)'),
        end: z.string().describe('End date (ISO format)'),
      }).optional().describe('Time range for evidence collection'),
      systems: z.array(z.string()).optional().describe('Specific systems to collect evidence from'),
    });
  • TypeScript interface defining the input arguments for the evidence collection tool, imported and used by the handler.
    export interface EvidenceCollectionArgs {
      action: 'collect' | 'schedule' | 'get_status' | 'download';
      collectionId?: string;
      framework?: 'hitrust' | 'iso27001' | 'soc2';
      controlIds?: string[];
      evidenceTypes?: ('configuration' | 'logs' | 'policies' | 'screenshots' | 'documents')[];
      settings?: {
        automated: boolean;
        scheduledTime?: string;
        retention: number; // days
        encryption: boolean;
        compression: boolean;
      };
    }
    
    export interface EvidenceCollection {
      id: string;
      name: string;
      status: 'scheduled' | 'running' | 'completed' | 'failed';
      framework: string;
      startedDate: string;
      completedDate?: string;
      progress: number;
      totalItems: number;
      collectedItems: number;
      failedItems: number;
      evidence: CollectedEvidence[];
      errors?: string[];
    }
    
    export interface CollectedEvidence {
      id: string;
      controlId: string;
      type: string;
      name: string;
      source: string;
      collectedDate: string;
      size: number; // bytes
      format: string;
      encrypted: boolean;
      filePath: string;
      checksum: string;
      metadata: Record<string, any>;
    }
  • Tool metadata including description, title, and annotations (readOnlyHint, destructiveHint, etc.) used in registration.
    manage_evidence_collection: {
      description: "Collect and preserve compliance evidence including audit logs, configuration snapshots, and attestation records.",
      title: "Evidence Collection Tool",
      annotations: { title: "Evidence Collection Tool", 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, so the agent knows this is a safe, repeatable read operation. The description adds useful context about what gets collected (compliance evidence types) and the preservation aspect, but doesn't disclose behavioral details like rate limits, authentication needs, or what 'preserve' entails operationally. 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. Every word earns its place: 'Collect and preserve' establishes the action, 'compliance evidence' specifies the domain, and the examples clarify scope without redundancy. No wasted words or structural issues.

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, rich annotations, and no output schema, the description is adequate but has gaps. It covers the what (compliance evidence collection) but not the how, when, or why relative to alternatives. The annotations handle safety profile, but the description could better explain the tool's role in the broader compliance workflow given the many sibling 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%, with all parameters well-documented in the schema itself. The description mentions 'compliance evidence' which aligns with the evidenceType enum values, but adds no additional parameter semantics beyond what the schema provides. The baseline of 3 is appropriate when 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 as 'Collect and preserve compliance evidence' with specific examples (audit logs, configuration snapshots, attestation records). It distinguishes itself from siblings like 'search_audit_log' or 'generate_audit_reports' by focusing on evidence collection and preservation rather than searching or reporting. However, it doesn't explicitly differentiate from 'manage_compliance_assessments' or 'manage_compliance_monitoring' which might have overlapping domains.

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, appropriate contexts, or exclusions. Given the sibling tools include various compliance and management functions, the agent receives no help in choosing between 'manage_evidence_collection' and tools like 'manage_compliance_assessments' or 'search_audit_log' for related tasks.

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