Skip to main content
GoogleSlidesTools enable an Agent to create, manage, and manipulate Google Slides presentations. Add slides with various layouts, insert text boxes, tables, images, and videos, read slide content, and manage slide order.

Getting Started

1

Install dependencies

uv pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
2

Setup Google Cloud project

Enable the Google Slides API and Google Drive API in your Google Cloud project, then create OAuth credentials.
  1. Go To API & Service > OAuth Consent Screen
  2. Select User Type
    • Google Workspace user: select Internal
    • Otherwise: select External
  3. Fill in app details (App name, logo, support email, etc)
  4. Select Scope
    • Click Add or Remove Scope
    • Select /auth/presentations and /auth/drive.file
    • Save and continue
  5. Add Test Users
    • Click Add Users and enter the email addresses to allow during testing
    • Only these users can access the app in “Testing” mode
  6. Generate OAuth 2.0 Client ID
    • Go to Credentials > Create Credentials > OAuth Client ID
    • Select Application Type as Desktop app
    • Download the JSON file
3

Configure authentication

export GOOGLE_CLIENT_ID=your_client_id_here
export GOOGLE_CLIENT_SECRET=your_client_secret_here
export GOOGLE_PROJECT_ID=your_project_id_here
4

Create and run an agent

cookbook/91_tools/googleslides_tools.py
from agno.agent import Agent
from agno.models.google import Gemini
from agno.tools.google.slides import GoogleSlidesTools

agent = Agent(
    model=Gemini(id="gemini-2.0-flash"),
    tools=[
        GoogleSlidesTools(
            oauth_port=8080,
        )
    ],
    instructions=[
        "You are a Google Slides assistant that helps users create and manage presentations.",
        "Always call get_presentation_metadata before modifying slides to get current slide IDs.",
        "Use slide_id values returned by the API -- never guess them.",
        "Return the presentation ID and URL after creating a presentation.",
    ],
    add_datetime_to_context=True,
    markdown=True,
)

agent.print_response(
    "Create a new Google Slides presentation titled 'Quarterly Business Review'. "
    "Then add the following slides: "
    "1. A TITLE slide with title 'Q3 2025 Business Review' and subtitle 'Prepared by the Strategy Team'. "
    "2. A TITLE_AND_BODY slide with title 'Agenda' and body listing: Revenue Overview, Key Metrics, Product Roadmap, Q4 Goals.",
    stream=True,
)

Toolkit Params

ParameterTypeDefaultDescription
credsCredentialsNonePre-fetched OAuth credentials to skip auth flow
creds_pathstrNonePath to OAuth credentials JSON file
token_pathstrNonePath to token file for storing access/refresh tokens
service_account_pathstrNonePath to service account JSON key. When set, OAuth is skipped
scopesList[str]NoneCustom OAuth scopes (defaults to presentations + drive.file)
oauth_portint0Port for OAuth authentication callback (0 = auto)
allboolFalseMaster override: enable all tools including destructive ones
enable_create_presentationboolTrueEnable create_presentation tool
enable_get_presentationboolTrueEnable get_presentation tool
enable_list_presentationsboolTrueEnable list_presentations tool
enable_get_presentation_metadataboolTrueEnable get_presentation_metadata tool
enable_get_pageboolTrueEnable get_page tool
enable_get_slide_textboolTrueEnable get_slide_text tool
enable_read_all_textboolTrueEnable read_all_text tool
enable_get_thumbnail_urlboolTrueEnable get_thumbnail_url tool
enable_add_slideboolTrueEnable add_slide tool
enable_add_text_boxboolTrueEnable add_text_box tool
enable_add_tableboolTrueEnable add_table tool
enable_set_background_imageboolTrueEnable set_background_image tool
enable_duplicate_slideboolTrueEnable duplicate_slide tool
enable_move_slidesboolTrueEnable move_slides tool
enable_insert_youtube_videoboolTrueEnable insert_youtube_video tool
enable_insert_drive_videoboolTrueEnable insert_drive_video tool
enable_batch_update_presentationboolTrueEnable batch_update_presentation tool
enable_delete_presentationboolFalseEnable delete_presentation tool (destructive)
enable_delete_slideboolFalseEnable delete_slide tool (destructive)

Toolkit Functions

Presentation Management

FunctionDescription
create_presentationCreate a blank presentation. Parameters: title (str)
get_presentationFetch full presentation metadata and content. Parameters: presentation_id (str), fields (str, optional)
list_presentationsList all accessible presentations. Parameters: page_size (int), page_token (str, optional)
get_presentation_metadataGet lightweight metadata (title, slide count, slide IDs). Parameters: presentation_id (str)

Reading Slides

FunctionDescription
get_pageRetrieve full content of a specific slide. Parameters: presentation_id (str), page_object_id (str)
get_slide_textExtract text content from a single slide. Parameters: presentation_id (str), page_object_id (str)
read_all_textExtract all text from every slide. Parameters: presentation_id (str)
get_thumbnail_urlGet thumbnail image URL for a slide. Parameters: presentation_id (str), slide_id (str)

Creating & Modifying Slides

FunctionDescription
add_slideAdd a slide with a layout and optional text. Parameters: presentation_id (str), layout (str), title (str), subtitle (str), body (str), body_2 (str), insertion_index (int)
add_text_boxCreate a positioned text box on a slide. Parameters: presentation_id (str), slide_id (str), text (str), x (float), y (float), width (float), height (float)
add_tableCreate a table, optionally pre-populated. Parameters: presentation_id (str), slide_id (str), rows (int), columns (int), content (list[list[str]])
set_background_imageSet a publicly accessible image as slide background. Parameters: presentation_id (str), slide_id (str), image_url (str)
duplicate_slideDuplicate a slide (copy inserted after original). Parameters: presentation_id (str), slide_id (str)
move_slidesReorder slides to a target position. Parameters: presentation_id (str), slide_ids (list[str]), insertion_index (int)
insert_youtube_videoEmbed a YouTube video on a slide. Parameters: presentation_id (str), slide_id (str), video_id (str), x (float), y (float), width (float), height (float)
insert_drive_videoEmbed a Google Drive video on a slide. Parameters: presentation_id (str), slide_id (str), file_id (str), x (float), y (float), width (float), height (float)
batch_update_presentationApply raw batch update requests for advanced operations. Parameters: presentation_id (str), requests (list[dict])

Destructive Operations

These tools are disabled by default. Pass enable_delete_presentation=True or enable_delete_slide=True to enable them.
FunctionDescription
delete_presentationPermanently delete a presentation via Drive API. Parameters: presentation_id (str)
delete_slideRemove a slide from the presentation. Parameters: presentation_id (str), slide_id (str)
You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Cookbook Examples

The googleslides_tools.py cookbook demonstrates 8 scenarios:
ScenarioTools Used
Create presentation with layoutscreate_presentation, add_slide (x5), get_presentation_metadata
Add table and text boxget_presentation_metadata, add_table, add_text_box
Read slide content and thumbnailsread_all_text, get_slide_text, get_thumbnail_url
Duplicate and reorder slidesget_presentation_metadata, duplicate_slide, move_slides
Get detailed presentation dataget_presentation, get_page, get_presentation_metadata
Insert YouTube videoget_presentation_metadata, insert_youtube_video
Set background imageget_presentation_metadata, set_background_image
List all presentationslist_presentations

Slide Layouts

The add_slide function supports the following Google Slides predefined layouts:
LayoutDescription
BLANKEmpty slide
TITLETitle and subtitle
TITLE_AND_BODYTitle with body text
TITLE_AND_TWO_COLUMNSTitle with two body columns
TITLE_ONLYTitle only, no body placeholder
SECTION_HEADERLarge section header
ONE_COLUMN_TEXTSingle column of text
MAIN_POINTLarge main point text
BIG_NUMBERLarge number display

Developer Resources