create_presentation
Generate a new Google Slides presentation by specifying a title and user email. Returns presentation details including ID and URL for easy access and sharing.
Instructions
Create a new Google Slides presentation.
Args: user_google_email (str): The user's Google email address. Required. title (str): The title for the new presentation. Defaults to "Untitled Presentation".
Returns: str: Details about the created presentation including ID and URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Untitled Presentation | |
| user_google_email | Yes |
Implementation Reference
- gslides/slides_tools.py:20-58 (handler)The handler function decorated with @server.tool() that implements the create_presentation MCP tool. It creates a new Google Slides presentation via the API, using the provided title, and returns a formatted confirmation message with the new presentation's ID and URL.@server.tool() @handle_http_errors("create_presentation", service_type="slides") @require_google_service("slides", "slides") async def create_presentation( service, user_google_email: str, title: str = "Untitled Presentation" ) -> str: """ Create a new Google Slides presentation. Args: user_google_email (str): The user's Google email address. Required. title (str): The title for the new presentation. Defaults to "Untitled Presentation". Returns: str: Details about the created presentation including ID and URL. """ logger.info(f"[create_presentation] Invoked. Email: '{user_google_email}', Title: '{title}'") body = { 'title': title } result = await asyncio.to_thread( service.presentations().create(body=body).execute ) presentation_id = result.get('presentationId') presentation_url = f"https://docs.google.com/presentation/d/{presentation_id}/edit" confirmation_message = f"""Presentation Created Successfully for {user_google_email}: - Title: {title} - Presentation ID: {presentation_id} - URL: {presentation_url} - Slides: {len(result.get('slides', []))} slide(s) created""" logger.info(f"Presentation created successfully for {user_google_email}") return confirmation_message
- gslides/slides_tools.py:20-20 (registration)The @server.tool() decorator registers the create_presentation function as an MCP tool.@server.tool()
- gslides/slides_tools.py:23-27 (schema)The function signature defines the input schema: user_google_email (required str), title (optional str, default 'Untitled Presentation'), and returns str.async def create_presentation( service, user_google_email: str, title: str = "Untitled Presentation" ) -> str: