Skip to main content
Glama
Ichigo3766

PowerPoint MCP Server

by Ichigo3766

save-presentation

Export PowerPoint presentations to a specified file path using the MCP server. Automatically saves output after adding slides, ensuring changes are stored securely for future use.

Instructions

Save the presentation to a file. Always use this tool at the end of any process that has added slides to a presentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNoPath where to save the presentation (optional)
presentation_nameYesName of the presentation to save

Implementation Reference

  • The handler logic for the 'save-presentation' tool. It retrieves the presentation object from the PresentationManager, determines the output file path, saves the presentation using the python-pptx library's prs.save() method, and returns a confirmation message.
    elif name == "save-presentation":
        presentation_name = arguments.get("presentation_name")
        output_path = arguments.get("output_path")
    
    
        if not presentation_name:
            raise ValueError("Missing presentation name")
    
        if presentation_name not in presentation_manager.presentations:
            raise ValueError(f"Presentation not found: {presentation_name}")
    
        prs = presentation_manager.presentations[presentation_name]
    
        # Default output path if none provided
        if not output_path:
            output_path = f"{presentation_name}.pptx"
    
        file_path = os.path.join(path,output_path)
        # Save the presentation
        try:
            prs.save(file_path)
        except Exception as e:
            raise ValueError(f"Unable to save the {presentation_name}. Error: {e}")
    
        return [
            types.TextContent(
                type="text",
                text=f"Saved presentation to: {file_path}"
            )
        ]
  • Registers the 'save-presentation' tool in the list_tools handler, including its description and input schema requiring 'presentation_name' and optionally 'output_path'.
    types.Tool(
        name="save-presentation",
        description="Save the presentation to a file. Always use this tool at the end of any process that has "
                    "added slides to a presentation.",
        inputSchema={
            "type": "object",
            "properties": {
                "presentation_name": {
                    "type": "string",
                    "description": "Name of the presentation to save",
                },
                "output_path": {
                    "type": "string",
                    "description": "Path where to save the presentation (optional)",
                },
            },
            "required": ["presentation_name"],
        },
    ),

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/Ichigo3766/powerpoint-mcp'

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