Skip to content

fix(slides): enable reliable Slides tool usage and write operations#237

Open
nlhogsten wants to merge 2 commits intogemini-cli-extensions:mainfrom
nlhogsten:google-slides-fix
Open

fix(slides): enable reliable Slides tool usage and write operations#237
nlhogsten wants to merge 2 commits intogemini-cli-extensions:mainfrom
nlhogsten:google-slides-fix

Conversation

@nlhogsten
Copy link

@nlhogsten nlhogsten commented Feb 24, 2026

Why this PR

Was using the Google Workspace MCP and found that Google Slides tools were either unavailable or failing when the agent attempted write operations.

This PR fixes the underlying Slides integration so Slides tools are actually usable and added a few tools to create slides files and individual slides.

Future PRs Planned

Created a small PR as requested by the contributing document - looking to create advanced Slides tools to decorate slides for things such as changing fonts, background colors and patterns, adding comments, manipulating layouts of elements present, ect.

What was broken

  • Slides write flows were unreliable in practice.
  • slides.create and related flows could fail on shape creation in common agent-generated requests.
  • Failure handling during seeded create could leave behind partial/empty decks.
  • Write tools did not return a consistent structured error shape.

What this PR changes

  • Enables/solidifies Slides write operations for MCP usage.
  • Adds and wires write-capable Slides tools, including:
    • slides.create
    • slides.addSlide
    • slides.insertText
    • slides.replaceText
    • slides.deleteSlide
    • slides.batchUpdate
  • Improves slides.create seeded deck behavior and rollback logic so failed seeded creates are cleaned up.
  • Uses layout-aware placeholder handling where appropriate and safe fallback behavior when placeholders are unavailable.
  • Standardizes write-operation error responses to a consistent structured payload.
  • Adds/updates tests covering Slides write paths and error cases.

Outcome

After these changes, Slides tool calls work in Gemini CLI with local MCP development setup, and presentations are created successfully in Google Slides.

Validation

  • Slides service test suite passes.
  • Project build passes.
  • Manual validation in Gemini CLI confirms successful Slides creation.

Screenshots

Gemini CLI successful Slides tool execution

Screenshot 2026-02-23 at 6 25 54 PM

Google Slides deck successfully created in Drive

Screenshot 2026-02-23 at 6 26 22 PM

@google-cla
Copy link

google-cla bot commented Feb 24, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nlhogsten, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Google Slides integration within the Gemini CLI by enabling full write capabilities. It introduces a suite of new tools for creating and manipulating presentations, slides, and text, ensuring reliable operation and improved error handling. The changes allow users to programmatically generate and modify Google Slides content, expanding the utility of the Slides integration beyond read-only access.

Highlights

  • Google Slides Write Operations Enabled: The Google Slides API scope has been upgraded from read-only to full presentations access, enabling comprehensive write functionalities.
  • New Slides Manipulation Tools Introduced: A suite of new tools (slides.create, slides.addSlide, slides.insertText, slides.replaceText, slides.deleteSlide, slides.batchUpdate) has been registered, allowing for programmatic creation and modification of presentations.
  • Robust Presentation Creation and Error Handling: The slides.create tool now supports seeding presentations with initial slides and moving them to specified folders. It also includes a rollback mechanism to delete partially created presentations if subsequent seeding fails.
  • Enhanced Slide and Text Management: New functionalities allow adding individual slides, inserting text into shapes (with automatic shape type mapping for 'TITLE' and 'SUBTITLE' to 'TEXT_BOX'), replacing text across an entire presentation, and deleting specific slides.
  • Comprehensive Test Coverage: Extensive unit tests have been added for all new Slides write operations, including various success and failure scenarios, ensuring reliability and correct behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • workspace-server/src/tests/services/SlidesService.test.ts
    • Added mocks for Slides and Drive API write operations.
    • Introduced new test suites for slidesService.create, addSlide, insertText, replaceText, deleteSlide, and batchUpdate.
    • Removed redundant beforeEach setup for getThumbnail mocks.
  • workspace-server/src/index.ts
    • Updated Google Slides API scope from read-only to full presentations access.
    • Registered new slides.create, slides.addSlide, slides.insertText, slides.replaceText, slides.deleteSlide, and slides.batchUpdate tools with detailed input schemas.
  • workspace-server/src/services/SlidesService.ts
    • Defined new TypeScript types and interfaces for Slides write operations.
    • Implemented private helper functions for object ID generation, shape geometry, layout handling, request building, and error formatting.
    • Added movePresentationToFolder utility to manage presentation placement in Drive folders.
    • Implemented public methods for create, addSlide, insertText, replaceText, deleteSlide, and batchUpdate Slides operations.
    • Incorporated rollback logic for failed seeded presentation creation.
    • Refactored existing read-only methods (getText, getMetadata, getImages, getSlideThumbnail) to use a common toPresentationId helper.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great addition, enabling write operations for Google Slides and adding a comprehensive set of tools. The inclusion of robust error handling with rollback logic for creation and extensive test coverage is commendable.

I have two main suggestions for improvement:

  1. Refactoring the slide creation logic to use layout placeholders instead of creating new shapes with hardcoded geometry. This will make the tool more robust and behave as users would expect with standard layouts.
  2. Standardizing the error response format across all new write-operation methods for better API consistency.

@nlhogsten
Copy link
Author

Addressed both Gemini review suggestions in commit 6e3b16c.

  1. Slide creation now uses layout placeholders for standard layouts.
  • Updated seeded create/addSlide request building to provide placeholderIdMappings and insert text into mapped placeholders (TITLE, BODY, SUBTITLE).
  • Kept geometry-based shape creation only as fallback when placeholders are unavailable (for example BLANK layout).
  1. Write-operation errors are now standardized.
  • slides.replaceText, slides.deleteSlide, and slides.batchUpdate now return { "error", "code", "retryable" } payloads using the shared write-error helper.

Validation:

  • workspace-server/src/__tests__/services/SlidesService.test.ts passes (26/26)
  • npm run build passes

@nlhogsten nlhogsten marked this pull request as ready for review February 24, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant