Skip to main content
Glama

create_presentation

Generate a new PowerPoint presentation with custom title, slide count, and template style for structured content delivery.

Instructions

Create a new PowerPoint presentation with specified title and number of slides

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNoOutput file path (optional, defaults to current directory)
slidesNoNumber of slides to create (default: 1)
templateNoPresentation template stylebasic
titleYesTitle of the presentation

Implementation Reference

  • Core handler function that creates PowerPoint presentation using pptxgenjs, applies templates, generates slides, saves to file, and returns success/error response.
    async run(args: { title: string; slides?: number; output_path?: string; template?: string }) {
      try {
        // Parameter validation
        if (!args.title) {
          throw new Error("Title is required");
        }
    
        const slideCount = args.slides || 1;
        const template = args.template || "basic";
        const outputPath = args.output_path || `${args.title.replace(/[^a-zA-Z0-9]/g, '_')}.pptx`;
    
        // Create new presentation
        const pres = new pptxgen();
        
        // Set presentation properties
        pres.author = "PPT-MCP";
        pres.company = "Generated by PPT-MCP";
        pres.title = args.title;
        
        // Apply template styling
        const templateStyles = getTemplateStyles(template);
        
        // Create title slide
        const titleSlide = pres.addSlide();
        titleSlide.addText(args.title, {
          x: 1,
          y: 2,
          w: 8,
          h: 2,
          fontSize: 44,
          bold: true,
          align: "center",
          color: templateStyles.titleColor
        });
        
        titleSlide.addText("Created with PPT-MCP", {
          x: 1,
          y: 5,
          w: 8,
          h: 1,
          fontSize: 18,
          align: "center",
          color: templateStyles.subtitleColor
        });
        
        // Create additional slides
        for (let i = 2; i <= slideCount; i++) {
          const slide = pres.addSlide();
          slide.addText(`Slide ${i}`, {
            x: 1,
            y: 0.5,
            w: 8,
            h: 1,
            fontSize: 32,
            bold: true,
            color: templateStyles.headerColor
          });
          
          slide.addText("Content goes here...", {
            x: 1,
            y: 2,
            w: 8,
            h: 4,
            fontSize: 16,
            color: templateStyles.contentColor
          });
        }
        
        // Ensure output directory exists
        const outputDir = path.dirname(outputPath);
        if (!fs.existsSync(outputDir)) {
          fs.mkdirSync(outputDir, { recursive: true });
        }
        
        // Save presentation
        await pres.writeFile({ fileName: outputPath });
        
        return {
          content: [{
            type: "text",
            text: `✅ **Presentation Created Successfully**\n\n` +
                  `📄 **Title:** ${args.title}\n` +
                  `📊 **Slides:** ${slideCount}\n` +
                  `🎨 **Template:** ${template}\n` +
                  `📁 **Output:** ${outputPath}\n\n` +
                  `The presentation has been saved and is ready to use!`
          }]
        };
        
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `❌ **Failed to create presentation:** ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    }
  • JSON schema defining input parameters for the create_presentation tool including title (required), slides, output_path, and template.
    parameters: {
      type: "object",
      properties: {
        title: {
          type: "string",
          description: "Title of the presentation"
        },
        slides: {
          type: "number",
          description: "Number of slides to create (default: 1)",
          default: 1
        },
        output_path: {
          type: "string",
          description: "Output file path (optional, defaults to current directory)"
        },
        template: {
          type: "string",
          description: "Presentation template style",
          enum: ["basic", "professional", "modern"],
          default: "basic"
        }
      },
      required: ["title"]
    },
  • src/index.ts:57-74 (registration)
    Registers the tool handler dispatch in MCP server for call_tool requests, mapping 'create_presentation' to pptCreator.run().
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      switch (request.params.name) {
        case "create_presentation":
          return await pptCreator.run(request.params.arguments as any || {});
        case "edit_presentation":
          return await pptEditor.run(request.params.arguments as any || {});
        case "read_presentation":
          return await pptReader.run(request.params.arguments as any || {});
        case "analyze_presentation":
          return await pptAnalyzer.run(request.params.arguments as any || {});
        case "edit_presentation_enhanced":
          return await pptEditorEnhanced.run(request.params.arguments as any || {});
        case "edit_presentation_advanced":
          return await pptEditorAdvanced.run(request.params.arguments as any || {});
        default:
          throw new Error(`Unknown tool: ${request.params.name}`);
      }
    });
  • src/index.ts:19-53 (registration)
    Registers the tool metadata (name, description, schema) for list_tools requests in MCP server.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: pptCreator.name,
            description: pptCreator.description,
            inputSchema: pptCreator.parameters
          },
          {
            name: pptEditor.name,
            description: pptEditor.description,
            inputSchema: pptEditor.parameters
          },
          {
            name: pptReader.name,
            description: pptReader.description,
            inputSchema: pptReader.parameters
          },
          {
            name: pptAnalyzer.name,
            description: pptAnalyzer.description,
            inputSchema: pptAnalyzer.parameters
          },
          {
            name: pptEditorEnhanced.name,
            description: pptEditorEnhanced.description,
            inputSchema: pptEditorEnhanced.parameters
          },
          {
            name: pptEditorAdvanced.name,
            description: pptEditorAdvanced.description,
            inputSchema: pptEditorAdvanced.parameters
          }
        ]
      };
  • Helper function providing color styles for different presentation templates used in the handler.
    function getTemplateStyles(template: string) {
      switch (template) {
        case "professional":
          return {
            titleColor: "2F4F4F",
            subtitleColor: "696969",
            headerColor: "2F4F4F",
            contentColor: "000000"
          };
        case "modern":
          return {
            titleColor: "4A90E2",
            subtitleColor: "7ED321",
            headerColor: "4A90E2",
            contentColor: "333333"
          };
        default: // basic
          return {
            titleColor: "000000",
            subtitleColor: "666666",
            headerColor: "000000",
            contentColor: "333333"
          };
      }
    }
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 states the tool creates a presentation but doesn't mention critical aspects like whether it overwrites existing files, requires authentication, has rate limits, or what the output looks like (e.g., file format, success indicators). This leaves significant gaps for an agent to understand 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 front-loads the core purpose without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it highly concise and well-structured.

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 complexity of a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens upon execution (e.g., file creation, error handling), return values, or behavioral constraints. For a tool that modifies the system by creating files, more context is needed to ensure safe and effective use.

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 description mentions 'title and number of slides', which aligns with two of the four parameters in the schema. However, with 100% schema description coverage, the schema already fully documents all parameters, including 'output_path' and 'template' with their defaults and options. The description adds minimal value beyond what's in the schema, meeting the baseline for high 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 action ('Create a new PowerPoint presentation') and specifies the key inputs ('with specified title and number of slides'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'edit_presentation' or 'read_presentation' beyond the creation aspect, which prevents a perfect score.

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 like 'edit_presentation' or 'read_presentation'. It lacks context about prerequisites, such as whether it requires specific software or permissions, or when it's appropriate for initial creation versus modification.

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/guangxiangdebizi/PPT-MCP'

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