save-presentation
Save PowerPoint presentations to files after creating or editing slides. Use this tool to store your presentation work permanently.
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
| Name | Required | Description | Default |
|---|---|---|---|
| presentation_name | Yes | Name of the presentation to save | |
| output_path | No | Path where to save the presentation (optional) |
Implementation Reference
- src/powerpoint/server.py:649-678 (handler)Handler for the 'save-presentation' tool. Retrieves the in-memory presentation object, determines the output file path (defaulting to presentation_name.pptx), saves it using python-pptx Presentation.save(), handles errors, and returns a text confirmation with the saved path.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}" ) ]
- src/powerpoint/server.py:343-361 (registration)Registration of the 'save-presentation' tool in the list_tools handler, including its schema defining required 'presentation_name' and optional '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"], }, ),