Skip to main content
Glama
Ichigo3766

PowerPoint MCP Server

by Ichigo3766

add-slide-title-with-table

Add a slide with a title and table to a PowerPoint presentation by specifying the presentation name, slide title, and table data. Simplifies data organization and presentation creation process.

Instructions

Add a new slide with a title and table containing the provided data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesTable data object with headers and rows
presentation_nameYesName of the presentation to add the slide to
titleYesTitle of the slide

Implementation Reference

  • Core implementation of the tool logic: adds a title slide and inserts a table with styled headers and data rows using the python-pptx library.
    def add_table_slide(self, presentation_name: str, title: str, headers: str, rows: str) -> Slide:
    
        try:
            prs = self.presentations[presentation_name]
        except KeyError as e:
            raise ValueError(f"Presentation '{presentation_name}' not found")
    
        slide_layout = prs.slide_layouts[self.SLIDE_LAYOUT_TITLE_ONLY]
        slide = prs.slides.add_slide(slide_layout)
    
        # Set the title
        title_shape = slide.shapes.title
        title_shape.text = title
    
        # Calculate table dimensions and position
        num_rows = len(rows) + 1  # +1 for header row
        num_cols = len(headers)
    
        # Position table in the middle of the slide with some margins
        x = Inches(1)  # Left margin
        y = Inches(2)  # Top margin below title
    
        # Make table width proportional to the number of columns
        width_per_col = Inches(8 / num_cols)  # Divide available width (8 inches) by number of columns
        height_per_row = Inches(0.4)  # Standard height per row
    
        # Create table
        shape = slide.shapes.add_table(
            num_rows,
            num_cols,
            x,
            y,
            width_per_col * num_cols,
            height_per_row * num_rows
        )
        table = shape.table
    
        # Add headers
        for col_idx, header in enumerate(headers):
            cell = table.cell(0, col_idx)
            cell.text = str(header)
            # Style header row
            paragraph = cell.text_frame.paragraphs[0]
            paragraph.font.bold = True
            paragraph.font.size = Pt(11)
    
    
    
        # Add data rows
        for row_idx, row_data in enumerate(rows, start=1):
            for col_idx, cell_value in enumerate(row_data):
                cell = table.cell(row_idx, col_idx)
                cell.text = str(cell_value)
                # Style data cells
                paragraph = cell.text_frame.paragraphs[0]
                paragraph.font.size = Pt(10)
    
        return slide
  • MCP tool dispatch handler: validates input arguments, checks presentation exists, validates table data structure, and delegates to PresentationManager.add_table_slide.
    elif name == "add-slide-title-with-table":
        presentation_name = arguments.get("presentation_name")
        title = arguments.get("title")
        table_data = arguments.get("data")
    
        if not all([presentation_name, title, table_data]):
            raise ValueError("Missing required arguments")
    
        if presentation_name not in presentation_manager.presentations:
            raise ValueError(f"Presentation not found: {presentation_name}")
    
        # Validate table data structure
        headers = table_data.get("headers", [])
        rows = table_data.get("rows", [])
    
        if not headers:
            raise ValueError("Table headers are required")
    
        if not rows:
            raise ValueError("Table rows are required")
    
        # Validate that all rows match header length
        if not all(len(row) == len(headers) for row in rows):
            raise ValueError("All rows must have the same number of columns as headers")
        try:
            slide = presentation_manager.add_table_slide(presentation_name, title, headers, rows)
        except Exception as e:
            raise ValueError(f"Unable to add slide '{title}' with a table to presentation: {presentation_name}")
    
        return [
            types.TextContent(
                type="text",
                text=f"Added slide '{title}' with a table to presentation: {presentation_name}"
            )
        ]
  • Tool registration in MCP server's list_tools() method, including name, description, and detailed input schema for table data.
    types.Tool(
        name="add-slide-title-with-table",
        description="Add a new slide with a title and table containing the provided data",
        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",
                },
                "data": {
                    "type": "object",
                    "description": "Table data object with headers and rows",
                    "properties": {
                        "headers": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Array of column headers"
                        },
                        "rows": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {"type": ["string", "number"]},
                            },
                            "description": "Array of row data arrays"
                        }
                    },
                    "required": ["headers", "rows"]
                }
            },
            "required": ["presentation_name", "title", "data"],
        },
    ),
  • Input schema definition specifying structure for presentation_name, title, and nested data object with headers (array of strings) and rows (array of arrays).
    types.Tool(
        name="add-slide-title-with-table",
        description="Add a new slide with a title and table containing the provided data",
        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",
                },
                "data": {
                    "type": "object",
                    "description": "Table data object with headers and rows",
                    "properties": {
                        "headers": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Array of column headers"
                        },
                        "rows": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {"type": ["string", "number"]},
                            },
                            "description": "Array of row data arrays"
                        }
                    },
                    "required": ["headers", "rows"]
                }
            },
            "required": ["presentation_name", "title", "data"],
        },
    ),
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions adding a slide, implying a mutation, but does not disclose behavioral traits like whether it requires specific permissions, if it modifies an existing presentation, what happens on errors, or if there are rate limits. The description is minimal and misses key operational details.

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 action. It wastes no words and is appropriately sized for the tool's complexity, making it easy to parse quickly.

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 tool involves mutation (adding a slide) with no annotations and no output schema, the description is incomplete. It does not cover behavioral aspects like error handling, side effects, or what is returned, leaving significant gaps for an agent to understand the tool's full context.

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 the schema fully documents the parameters. The description adds minimal value by implying the 'data' parameter is used for the table, but does not elaborate on semantics beyond what the schema provides, such as formatting expectations or constraints.

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 verb 'add' and the resource 'new slide', specifying it includes a title and table with provided data. It distinguishes from siblings like 'add-slide-title-only' or 'add-slide-title-with-chart' by mentioning the table, but could be more explicit about the uniqueness compared to other table-related tools if any existed.

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 'add-slide-title-content' or 'add-slide-title-with-chart'. It lacks context on prerequisites, such as whether the presentation must exist or be open, or when a table is preferred over other content types.

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

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

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