generate_powerpoint
Create a PowerPoint presentation from plain text. Choose template, length, tone, and branding. Returns a task ID to monitor progress.
Instructions
Generate a PowerPoint presentation from text content using specified template.
Returns a task_id that can be used with getTaskStatus to check progress.
When the task completes, the result will contain a presentation_id and request_id.
Use the request_id with the downloadPresentation tool to get the download URL.
IMPORTANT: This tool returns immediately with a task_id. You MUST then call
getTaskStatus with the task_id to poll for completion. Keep polling every few
seconds until the status is SUCCESS or FAILED.
Parameters:
Required:
- plain_text (str): The topic to generate a presentation about
- length (int): The number of slides
- template (str): Template name or ID
Optional:
- document_uuids (list[str]): UUIDs of uploaded documents to use
- language (str): Language code (default: 'ORIGINAL')
- fetch_images (bool): Include stock images (default: True)
- use_document_images (bool): Include images from documents (default: False)
- tone (str): Text tone - 'default', 'casual', 'professional', 'funny', 'educational', 'sales_pitch' (default: 'default')
- verbosity (str): Text length - 'concise', 'standard', 'text-heavy' (default: 'standard')
- custom_user_instructions (str): Custom generation instructions
- include_cover (bool): Include cover slide (default: True)
- include_table_of_contents (bool): Include TOC slides (default: True)
- add_speaker_notes (bool): Add speaker notes (default: False)
- use_general_knowledge (bool): Expand with related info (default: False)
- use_wording_from_document (bool): Use document wording (default: False)
- response_format (str): 'powerpoint' or 'pdf' (default: 'powerpoint')
- use_branding_logo (bool): Include brand logo (default: False)
- use_branding_fonts (bool): Apply brand fonts (default: False)
- use_branding_color (bool): Apply brand colors (default: False)
- branding_logo (str): Custom logo URL
- branding_fonts (dict): The object of brand fonts to be used in the slidesInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plain_text | Yes | ||
| length | Yes | ||
| template | Yes | ||
| document_uuids | No | ||
| language | No | ORIGINAL | |
| fetch_images | No | ||
| use_document_images | No | ||
| tone | No | default | |
| verbosity | No | standard | |
| custom_user_instructions | No | ||
| include_cover | No | ||
| include_table_of_contents | No | ||
| add_speaker_notes | No | ||
| use_general_knowledge | No | ||
| use_wording_from_document | No | ||
| response_format | No | powerpoint | |
| use_branding_logo | No | ||
| use_branding_fonts | No | ||
| use_branding_color | No | ||
| branding_logo | No | ||
| branding_fonts | No |
Implementation Reference
- slidespeak.py:122-123 (registration)The tool 'generate_powerpoint' is registered as an MCP tool using the @mcp.tool() decorator on line 122.
@mcp.tool() async def generate_powerpoint( - slidespeak.py:123-253 (handler)The handler function 'generate_powerpoint' that executes the tool logic. It accepts plain_text, length, template, and many optional parameters, builds a payload, calls the SlideSpeak API endpoint /presentation/generate, and returns a task_id for polling.
async def generate_powerpoint( plain_text: str, length: int, template: str, document_uuids: Optional[list[str]] = None, *, language: Optional[str] = "ORIGINAL", fetch_images: Optional[bool] = True, use_document_images: Optional[bool] = False, tone: Optional[Literal['default','casual','professional','funny','educational','sales_pitch']] = 'default', verbosity: Optional[Literal['concise','standard','text-heavy']] = 'standard', custom_user_instructions: Optional[str] = None, include_cover: Optional[bool] = True, include_table_of_contents: Optional[bool] = True, add_speaker_notes: Optional[bool] = False, use_general_knowledge: Optional[bool] = False, use_wording_from_document: Optional[bool] = False, response_format: Optional[Literal['powerpoint','pdf']] = 'powerpoint', use_branding_logo: Optional[bool] = False, use_branding_fonts: Optional[bool] = False, use_branding_color: Optional[bool] = False, branding_logo: Optional[str] = None, branding_fonts: Optional[dict[str, str]] = None, ) -> str: """ Generate a PowerPoint presentation from text content using specified template. Returns a task_id that can be used with getTaskStatus to check progress. When the task completes, the result will contain a presentation_id and request_id. Use the request_id with the downloadPresentation tool to get the download URL. IMPORTANT: This tool returns immediately with a task_id. You MUST then call getTaskStatus with the task_id to poll for completion. Keep polling every few seconds until the status is SUCCESS or FAILED. Parameters: Required: - plain_text (str): The topic to generate a presentation about - length (int): The number of slides - template (str): Template name or ID Optional: - document_uuids (list[str]): UUIDs of uploaded documents to use - language (str): Language code (default: 'ORIGINAL') - fetch_images (bool): Include stock images (default: True) - use_document_images (bool): Include images from documents (default: False) - tone (str): Text tone - 'default', 'casual', 'professional', 'funny', 'educational', 'sales_pitch' (default: 'default') - verbosity (str): Text length - 'concise', 'standard', 'text-heavy' (default: 'standard') - custom_user_instructions (str): Custom generation instructions - include_cover (bool): Include cover slide (default: True) - include_table_of_contents (bool): Include TOC slides (default: True) - add_speaker_notes (bool): Add speaker notes (default: False) - use_general_knowledge (bool): Expand with related info (default: False) - use_wording_from_document (bool): Use document wording (default: False) - response_format (str): 'powerpoint' or 'pdf' (default: 'powerpoint') - use_branding_logo (bool): Include brand logo (default: False) - use_branding_fonts (bool): Apply brand fonts (default: False) - use_branding_color (bool): Apply brand colors (default: False) - branding_logo (str): Custom logo URL - branding_fonts (dict): The object of brand fonts to be used in the slides """ generation_endpoint = "/presentation/generate" if not API_KEY: return "API Key is missing. Cannot process any requests." # Validate cross-field requirements if (use_document_images or use_wording_from_document) and not document_uuids: return ( "When use_document_images or use_wording_from_document is true, you must provide document_uuids." ) payload: dict[str, Any] = { "plain_text": plain_text, "length": length, "template": template, } if document_uuids: payload["document_uuids"] = document_uuids if language is not None: payload["language"] = language if fetch_images is not None: payload["fetch_images"] = fetch_images if use_document_images is not None: payload["use_document_images"] = use_document_images if tone is not None: payload["tone"] = tone if verbosity is not None: payload["verbosity"] = verbosity if custom_user_instructions is not None and custom_user_instructions.strip(): payload["custom_user_instructions"] = custom_user_instructions if include_cover is not None: payload["include_cover"] = include_cover if include_table_of_contents is not None: payload["include_table_of_contents"] = include_table_of_contents if add_speaker_notes is not None: payload["add_speaker_notes"] = add_speaker_notes if use_general_knowledge is not None: payload["use_general_knowledge"] = use_general_knowledge if use_wording_from_document is not None: payload["use_wording_from_document"] = use_wording_from_document if response_format is not None: payload["response_format"] = response_format if use_branding_logo is not None: payload["use_branding_logo"] = use_branding_logo if use_branding_fonts is not None: payload["use_branding_fonts"] = use_branding_fonts if use_branding_color is not None: payload["use_branding_color"] = use_branding_color if branding_logo is not None: payload["branding_logo"] = branding_logo if branding_fonts is not None: payload["branding_fonts"] = branding_fonts # Initiate generation — returns immediately with task_id init_result = await _make_api_request("POST", generation_endpoint, payload=payload, timeout=GENERATION_TIMEOUT) if not init_result: return "Failed to initiate PowerPoint generation due to an API error. Check server logs." task_id = init_result.get("task_id") if not task_id: return f"Failed to initiate PowerPoint generation. API response did not contain a task ID. Response: {init_result}" logging.info(f"PowerPoint generation initiated. Task ID: {task_id}") return ( f"Generation started. Task ID: {task_id}\n\n" f"The presentation is being generated. Use getTaskStatus with task_id '{task_id}' " f"to check progress. Poll every few seconds until status is SUCCESS.\n" f"Once complete, use downloadPresentation with the request_id from the task result." )