Skip to main content
Glama
Ichigo3766

PowerPoint MCP Server

by Ichigo3766

add-slide-comparison

Create a comparison slide in PowerPoint presentations to contrast two concepts with structured titles and content. Define left and right side details to highlight differences effectively.

Instructions

Add a new a comparison slide with title and comparison content. Use when you wish to compare two concepts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
left_side_contentYesContent/body text of left concept. Separate main points with a single carriage return character.Make sub-points with tab character.Do not use bullet points, asterisks or dashes for points.Max main points is 4
left_side_titleYesTitle of the left concept
presentation_nameYesName of the presentation to add the slide to
right_side_contentYesContent/body text of right concept. Separate main points with a single carriage return character.Make sub-points with tab character.Do not use bullet points, asterisks or dashes for points.Max main points is 4
right_side_titleYesTitle of the right concept
titleYesTitle of the slide

Implementation Reference

  • Core handler function that adds a comparison slide to the presentation using layout 4 (SLIDE_LAYOUT_COMPARISON), setting title and content in left/right placeholders.
    def add_comparison_slide(self, presentation_name: str, title: str, left_side_title: str, left_side_content: str,
                             right_side_title: str, right_side_content: str ):
        """
        Create a section header slide for the given presentation
    
        Args:
            presentation_name: The presentation to add the slide to
            title: The title of the slide
            left_side_title: The title of the left hand side content
            left_side_content: The body content for the left hand side
            right_side_title: The title of the right hand side content
            right_side_content: The body content for the right hand side
        """
        try:
            prs = self.presentations[presentation_name]
        except KeyError as e:
            raise ValueError(f"Presentation '{presentation_name}' not found")
        slide_master = prs.slide_master
    
        # Add a new slide with layout
        slide_layout = prs.slide_layouts[self.SLIDE_LAYOUT_COMPARISON]
        slide = prs.slides.add_slide(slide_layout)
    
        # Set the title
        title_shape = slide.shapes.title
        title_shape.text = title
    
        # Build the left hand content
        content_shape = slide.placeholders[1]
        text_frame = content_shape.text_frame
        text_frame.text = left_side_title
    
        content_shape = slide.placeholders[2]
        text_frame = content_shape.text_frame
        text_frame.text = left_side_content
    
        # Build the right hand content
        content_shape = slide.placeholders[3]
        text_frame = content_shape.text_frame
        text_frame.text = right_side_title
    
        content_shape = slide.placeholders[4]
        text_frame = content_shape.text_frame
        text_frame.text = right_side_content
        return slide
  • MCP server tool call handler for 'add-slide-comparison': validates arguments, retrieves presentation, calls PresentationManager.add_comparison_slide, and returns success message.
    elif name == "add-slide-comparison":
        # Get arguments
        presentation_name = arguments["presentation_name"]
        title = arguments["title"]
        left_side_title = arguments["left_side_title"]
        left_side_content = arguments["left_side_content"]
        right_side_title = arguments["right_side_title"]
        right_side_content = arguments["right_side_content"]
    
        if not all([presentation_name, title, left_side_title, left_side_content,
                    right_side_title, right_side_content]):
            raise ValueError("Missing required arguments")
    
        if presentation_name not in presentation_manager.presentations:
            raise ValueError(f"Presentation not found: {presentation_name}")
        try:
            slide = presentation_manager.add_comparison_slide(presentation_name, title, left_side_title,
                                                              left_side_content, right_side_title, right_side_content)
        except Exception as e:
            raise ValueError(f"Unable to add comparison slide to {presentation_name}.pptx")
    
        return [types.TextContent(
            type="text",
            text=f"Successfully added comparison slide {title} to {presentation_name}.pptx"
        )]
  • Tool registration in list_tools(): defines name, description, and detailed inputSchema for 'add-slide-comparison' tool.
    types.Tool(
        name="add-slide-comparison",
        description="Add a new a comparison slide with title and comparison content. Use when you wish to "
                    "compare two concepts",
        inputSchema={
            "type": "object",
            "properties": {
                "presentation_name": {
                    "type": "string",
                    "description": "Name of the presentation to add the slide to",
                },
                "title": {
                    "type": "string",
                    "description": "Title of the slide",
                },
                "left_side_title": {
                    "type": "string",
                    "description": "Title of the left concept",
                },
                "left_side_content": {
                    "type": "string",
                    "description": "Content/body text of left concept. "
                                   "Separate main points with a single carriage return character."
                                   "Make sub-points with tab character."
                                   "Do not use bullet points, asterisks or dashes for points."
                                   "Max main points is 4"
                },
                "right_side_title": {
                    "type": "string",
                    "description": "Title of the right concept",
                },
                "right_side_content": {
                    "type": "string",
                    "description": "Content/body text of right concept. "
                                   "Separate main points with a single carriage return character."
                                   "Make sub-points with tab character."
                                   "Do not use bullet points, asterisks or dashes for points."
                                   "Max main points is 4"
                },
            },
            "required": ["presentation_name", "title", "left_side_title", "left_side_content",
                         "right_side_title", "right_side_content"],
        },
    ),
  • Input schema definition for the 'add-slide-comparison' tool, specifying properties and requirements for presentation_name, title, left/right side titles and contents.
    types.Tool(
        name="add-slide-comparison",
        description="Add a new a comparison slide with title and comparison content. Use when you wish to "
                    "compare two concepts",
        inputSchema={
            "type": "object",
            "properties": {
                "presentation_name": {
                    "type": "string",
                    "description": "Name of the presentation to add the slide to",
                },
                "title": {
                    "type": "string",
                    "description": "Title of the slide",
                },
                "left_side_title": {
                    "type": "string",
                    "description": "Title of the left concept",
                },
                "left_side_content": {
                    "type": "string",
                    "description": "Content/body text of left concept. "
                                   "Separate main points with a single carriage return character."
                                   "Make sub-points with tab character."
                                   "Do not use bullet points, asterisks or dashes for points."
                                   "Max main points is 4"
                },
                "right_side_title": {
                    "type": "string",
                    "description": "Title of the right concept",
                },
                "right_side_content": {
                    "type": "string",
                    "description": "Content/body text of right concept. "
                                   "Separate main points with a single carriage return character."
                                   "Make sub-points with tab character."
                                   "Do not use bullet points, asterisks or dashes for points."
                                   "Max main points is 4"
                },
            },
            "required": ["presentation_name", "title", "left_side_title", "left_side_content",
                         "right_side_title", "right_side_content"],
        },
    ),
  • Layout constant used for comparison slides (SLIDE_LAYOUT_COMPARISON = 4).
    SLIDE_LAYOUT_COMPARISON = 4

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