Google Slides

GoogleSlidesTools create, edit, and read Google Slides presentations, including slides, tables, and embedded videos.

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

Install dependencies

uv pip install agno google-api-python-client google-auth-httplib2 google-auth-oauthlib openai

Setup Google Cloud project

Enable the Google Slides API and Google Drive API in your Google Cloud project, then create OAuth credentials.

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

Create and run an agent

Set OPENAI_API_KEY in this terminal before running the agent:

export OPENAI_API_KEY="your-openai-api-key"
cookbook/91_tools/google/slides/basic.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.google.slides import GoogleSlidesTools

agent = Agent(
    name="Slides Assistant",
    model=OpenAIResponses(id="gpt-5.5"),
    tools=[GoogleSlidesTools()],
    instructions=[
        "You are a Google Slides assistant.",
        "Always call get_presentation_metadata before modifying slides.",
        "Use slide_id values returned by the API -- never guess them.",
        "Return both id and url with any additional text.",
    ],
    markdown=True,
)

agent.print_response(
    "Create a new Google Slides presentation titled 'Q3 2026 Business Review'. "
    "Then add a TITLE slide with title 'Q3 2026 Business Review' and subtitle "
    "'Prepared by the Strategy Team'.",
    stream=True,
)

list_presentations defaults to 20 results per page. Other methods such as read_all_text are not subject to that result cap. With the default drive.file scope, discovery covers files authorized for this app, not every presentation the user can access.

Toolkit Params

ParameterTypeDefaultDescription
max_resultsint20Maximum results per API request to prevent context overflow
credsCredentialsNonePre-fetched OAuth credentials to skip auth flow
credentials_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
delegated_userstrNoneEmail to impersonate when using service account auth
scopesList[str]NoneCustom OAuth scopes (defaults to presentations + drive.file)
oauth_portint0Port for OAuth authentication callback (0 = auto)
login_hintstrNoneEmail to pre-select in the OAuth consent screen
allboolFalseMaster override: enable all tools including destructive ones
create_presentationboolTrueEnable create_presentation tool
get_presentationboolTrueEnable get_presentation tool
list_presentationsboolTrueEnable list_presentations tool
get_presentation_metadataboolTrueEnable get_presentation_metadata tool
get_pageboolTrueEnable get_page tool
get_slide_textboolTrueEnable get_slide_text tool
read_all_textboolTrueEnable read_all_text tool
get_slide_thumbnailboolTrueEnable get_slide_thumbnail tool
add_slideboolTrueEnable add_slide tool
add_text_boxboolTrueEnable add_text_box tool
add_tableboolTrueEnable add_table tool
set_background_imageboolTrueEnable set_background_image tool
duplicate_slideboolTrueEnable duplicate_slide tool
move_slidesboolTrueEnable move_slides tool
insert_youtube_videoboolTrueEnable insert_youtube_video tool
insert_drive_videoboolTrueEnable insert_drive_video tool
delete_presentationboolFalseEnable delete_presentation tool (destructive)
delete_slideboolFalseEnable delete_slide tool (destructive)
instructionsstrNoneCustom instructions. Defaults to built-in Slides workflow guidance
add_instructionsboolTrueInject the instructions into the agent system prompt

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 presentations accessible under the granted Drive scope, one page at a time. 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_slide_thumbnailGet thumbnail image URL for a slide. Parameters: presentation_id (str), slide_id (str)

Creating & Modifying Slides

Position and size parameters (x, y, width, height) are in inches; the toolkit converts them to Google Slides EMU units.

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)

Destructive Operations

These tools are disabled by default. Pass delete_presentation=True or 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 slides cookbook covers four scenarios:

ExampleWhat it demonstrates
basic.pyCreate a presentation and add slides with layouts
content_reader.pyRead slide text and fetch slide thumbnails
presentation_builder.pyBuild a multi-slide presentation with tables and text boxes
media_slides.pyEmbed YouTube and Drive videos and set background images

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
SECTION_TITLE_AND_DESCRIPTIONSection title with description
ONE_COLUMN_TEXTSingle column of text
MAIN_POINTLarge main point text
BIG_NUMBERLarge number display
CAPTION_ONLYCaption text only

Shared Google authentication

The current Google Workspace toolkits accept auth=AuthConfig(...) through their shared base class. Reuse one config across Drive, Sheets, Slides, or Calendar toolkits to aggregate the scopes before the first authentication:

from agno.tools.google.auth import AuthConfig

auth = AuthConfig(interactive=False, http_timeout=60)

Pass auth=auth to each toolkit constructor. This headless configuration requires existing usable credentials; it raises instead of opening a browser when interactive authorization would be needed. For an initial local OAuth sign-in, use interactive=True with the client credentials described above.

AuthConfig also accepts a supported db for token storage. Encryption is enabled by default and requires a token_encryption_key (or GOOGLE_TOKEN_ENCRYPTION_KEY). Its database token identity is shared for this Google configuration; it does not automatically select credentials by the agent's user_id. Put service-account and delegated-user settings on AuthConfig when using auth=, rather than mixing those legacy constructor arguments. Service accounts must have the target resources shared with them or appropriate delegated access.

See the AuthConfig source for the full configuration.

Developer Resources