Skip to main content
Glama
DynamicEndpoints

Microsoft 365 Core MCP Server

generate_powerpoint_presentation

Create professional PowerPoint presentations with custom slides, charts, tables, and themes using Microsoft 365 data.

Instructions

Create professional PowerPoint presentations with custom slides, charts, tables, and themes from Microsoft 365 data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform: create new presentation, get existing, list all, or export to format
fileNameNoName for the new presentation file (for create action)
driveIdNoOneDrive/SharePoint drive ID where file should be created (default: user's OneDrive)
folderIdNoFolder ID within the drive (default: root)
templateNoTemplate configuration for presentation styling
slidesNoArray of slide definitions to create
fileIdNoFile ID for get/export actions
formatNoExport format (for export action)
filterNoOData filter for list action
topNoNumber of results to return (for list action)

Implementation Reference

  • Registers the 'generate_powerpoint_presentation' tool with the MCP server, specifying description, input schema, annotations, and handler function.
      "generate_powerpoint_presentation",
      "Create professional PowerPoint presentations with custom slides, charts, tables, and themes from Microsoft 365 data.",
      powerPointPresentationArgsSchema.shape,
      {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false},
      wrapToolHandler(async (args: PowerPointPresentationArgs) => {
        this.validateCredentials();
        try {
          const result = await handlePowerPointPresentations(args, this.getGraphClient());
          return { content: [{ type: 'text', text: result }] };
        } catch (error) {
          if (error instanceof McpError) {
            throw error;
          }
          throw new McpError(
            ErrorCode.InternalError,
            `Error generating PowerPoint presentation: ${error instanceof Error ? error.message : 'Unknown error'}`
          );
        }
      })
    );
  • Primary handler function that dispatches to specific PowerPoint operations (create, get, list, export) based on input args.action.
    export async function handlePowerPointPresentations(
      args: PowerPointPresentationArgs,
      graphClient: Client
    ): Promise<string> {
      try {
        switch (args.action) {
          case 'create':
            return await createPresentation(args, graphClient);
          case 'get':
            return await getPresentation(args, graphClient);
          case 'list':
            return await listPresentations(args, graphClient);
          case 'export':
            return await exportPresentation(args, graphClient);
          default:
            throw new McpError(
              ErrorCode.InvalidRequest,
              `Unknown action: ${args.action}`
            );
        }
      } catch (error) {
        if (error instanceof McpError) throw error;
        throw new McpError(
          ErrorCode.InternalError,
          `PowerPoint operation failed: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Core implementation for creating a new PowerPoint presentation: generates XML content, uploads to OneDrive/SharePoint via Graph API, returns file details.
    async function createPresentation(
      args: PowerPointPresentationArgs,
      graphClient: Client
    ): Promise<string> {
      if (!args.fileName) {
        throw new McpError(ErrorCode.InvalidRequest, 'fileName is required for create action');
      }
    
      if (!args.slides || args.slides.length === 0) {
        throw new McpError(ErrorCode.InvalidRequest, 'At least one slide is required');
      }
    
      // Determine drive location (default to user's OneDrive)
      const driveId = args.driveId || 'me';
      const folderPath = args.folderId ? `/items/${args.folderId}` : '/root';
    
      // Create empty PowerPoint file
      const fileName = args.fileName.endsWith('.pptx') ? args.fileName : `${args.fileName}.pptx`;
      
      // Create file with content
      const presentationContent = generatePresentationXML(args.slides, args.template);
      
      const uploadedFile = await graphClient
        .api(`/drives/${driveId}${folderPath}:/${fileName}:/content`)
        .header('Content-Type', 'application/vnd.openxmlformats-officedocument.presentationml.presentation')
        .put(presentationContent);
    
      return JSON.stringify({
        success: true,
        fileId: uploadedFile.id,
        fileName: uploadedFile.name,
        webUrl: uploadedFile.webUrl,
        driveId: uploadedFile.parentReference?.driveId,
        message: `PowerPoint presentation "${fileName}" created successfully with ${args.slides.length} slides`
      }, null, 2);
    }
  • Zod schema defining input parameters and validation for the generate_powerpoint_presentation tool, including action types, file locations, slide content, and export options.
    export const powerPointPresentationArgsSchema = z.object({
      action: z.enum(['create', 'get', 'list', 'export'])
        .describe('Action to perform: create new presentation, get existing, list all, or export to format'),
      fileName: z.string().optional()
        .describe('Name for the new presentation file (for create action)'),
      driveId: z.string().optional()
        .describe('OneDrive/SharePoint drive ID where file should be created (default: user\'s OneDrive)'),
      folderId: z.string().optional()
        .describe('Folder ID within the drive (default: root)'),
      template: powerPointTemplateSchema.optional()
        .describe('Template configuration for presentation styling'),
      slides: z.array(powerPointSlideSchema).optional()
        .describe('Array of slide definitions to create'),
      fileId: z.string().optional()
        .describe('File ID for get/export actions'),
      format: z.enum(['pptx', 'pdf', 'odp']).optional()
        .describe('Export format (for export action)'),
      filter: z.string().optional()
        .describe('OData filter for list action'),
      top: z.number().optional()
        .describe('Number of results to return (for list action)')
    });
  • Metadata definition for the generate_powerpoint_presentation tool, providing description, title, and operational annotations used in tool registration and discovery.
    generate_powerpoint_presentation: {
      description: "Create professional PowerPoint presentations with custom slides, charts, tables, and themes from Microsoft 365 data.",
      title: "PowerPoint Generator",
      annotations: { title: "PowerPoint Generator", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }
    },
Behavior3/5

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

Annotations indicate this is a non-readOnly, non-idempotent, non-destructive tool. The description adds some behavioral context by mentioning 'professional PowerPoint presentations' and 'Microsoft 365 data', which suggests integration with Microsoft services. However, it doesn't elaborate on authentication needs, rate limits, or what 'create' entails beyond the basic action. The description doesn't contradict annotations but adds minimal value beyond them.

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. It wastes no words and directly communicates the tool's function without unnecessary elaboration. Every part of the sentence contributes to understanding what the tool does.

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 (10 parameters, nested objects, no output schema) and annotations covering basic safety, the description is minimally adequate. It states what the tool does but lacks details on return values, error handling, or integration specifics. For a multi-action tool (create/get/list/export) with rich parameters, more context would be helpful, but the schema compensates somewhat.

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 parameters are well-documented in the schema. The description mentions 'custom slides, charts, tables, and themes', which loosely maps to the 'slides' and 'template' parameters, but adds no specific syntax or format details beyond what the schema provides. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't significantly enhance parameter understanding.

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: 'Create professional PowerPoint presentations with custom slides, charts, tables, and themes from Microsoft 365 data.' It specifies the verb ('Create') and resource ('PowerPoint presentations'), and mentions key capabilities. However, it doesn't differentiate from sibling tools like 'generate_word_document' or 'generate_html_report' beyond mentioning PowerPoint specifically.

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 to choose PowerPoint over other report formats, or how it relates to sibling tools like 'generate_word_document' or 'generate_html_report'. 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