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 openaiSetup Google Cloud project
Enable the Google Slides API and Google Drive API in your Google Cloud project, then create OAuth credentials.
-
Go To API & Service > OAuth Consent Screen
-
Select User Type
- Google Workspace user: select Internal
- Otherwise: select External
-
Fill in app details (App name, logo, support email, etc)
-
Select Scope
- Click Add or Remove Scope
- Select
/auth/presentationsand/auth/drive.file - Save and continue
-
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
-
Generate OAuth 2.0 Client ID
- Go to Credentials > Create Credentials > OAuth Client ID
- Select Application Type as Desktop app
- Download the JSON file
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_herePlace the downloaded credentials.json in your working directory, or pass the path explicitly.
GoogleSlidesTools(credentials_path="path/to/credentials.json")For server/bot deployments without browser access. Create a service account at IAM & Admin > Service Accounts, download the JSON key file, then:
export GOOGLE_SERVICE_ACCOUNT_FILE=/path/to/service-account-key.jsonOr pass it directly:
GoogleSlidesTools(service_account_path="path/to/service-account.json")Create and run an agent
Set OPENAI_API_KEY in this terminal before running the agent:
export OPENAI_API_KEY="your-openai-api-key"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
| Parameter | Type | Default | Description |
|---|---|---|---|
max_results | int | 20 | Maximum results per API request to prevent context overflow |
creds | Credentials | None | Pre-fetched OAuth credentials to skip auth flow |
credentials_path | str | None | Path to OAuth credentials JSON file |
token_path | str | None | Path to token file for storing access/refresh tokens |
service_account_path | str | None | Path to service account JSON key. When set, OAuth is skipped |
delegated_user | str | None | Email to impersonate when using service account auth |
scopes | List[str] | None | Custom OAuth scopes (defaults to presentations + drive.file) |
oauth_port | int | 0 | Port for OAuth authentication callback (0 = auto) |
login_hint | str | None | Email to pre-select in the OAuth consent screen |
all | bool | False | Master override: enable all tools including destructive ones |
create_presentation | bool | True | Enable create_presentation tool |
get_presentation | bool | True | Enable get_presentation tool |
list_presentations | bool | True | Enable list_presentations tool |
get_presentation_metadata | bool | True | Enable get_presentation_metadata tool |
get_page | bool | True | Enable get_page tool |
get_slide_text | bool | True | Enable get_slide_text tool |
read_all_text | bool | True | Enable read_all_text tool |
get_slide_thumbnail | bool | True | Enable get_slide_thumbnail tool |
add_slide | bool | True | Enable add_slide tool |
add_text_box | bool | True | Enable add_text_box tool |
add_table | bool | True | Enable add_table tool |
set_background_image | bool | True | Enable set_background_image tool |
duplicate_slide | bool | True | Enable duplicate_slide tool |
move_slides | bool | True | Enable move_slides tool |
insert_youtube_video | bool | True | Enable insert_youtube_video tool |
insert_drive_video | bool | True | Enable insert_drive_video tool |
delete_presentation | bool | False | Enable delete_presentation tool (destructive) |
delete_slide | bool | False | Enable delete_slide tool (destructive) |
instructions | str | None | Custom instructions. Defaults to built-in Slides workflow guidance |
add_instructions | bool | True | Inject the instructions into the agent system prompt |
Toolkit Functions
Presentation Management
| Function | Description |
|---|---|
create_presentation | Create a blank presentation. Parameters: title (str) |
get_presentation | Fetch full presentation metadata and content. Parameters: presentation_id (str), fields (str, optional) |
list_presentations | List presentations accessible under the granted Drive scope, one page at a time. Parameters: page_size (int), page_token (str, optional) |
get_presentation_metadata | Get lightweight metadata (title, slide count, slide IDs). Parameters: presentation_id (str) |
Reading Slides
| Function | Description |
|---|---|
get_page | Retrieve full content of a specific slide. Parameters: presentation_id (str), page_object_id (str) |
get_slide_text | Extract text content from a single slide. Parameters: presentation_id (str), page_object_id (str) |
read_all_text | Extract all text from every slide. Parameters: presentation_id (str) |
get_slide_thumbnail | Get 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.
| Function | Description |
|---|---|
add_slide | Add 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_box | Create 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_table | Create a table, optionally pre-populated. Parameters: presentation_id (str), slide_id (str), rows (int), columns (int), content (list[list[str]]) |
set_background_image | Set a publicly accessible image as slide background. Parameters: presentation_id (str), slide_id (str), image_url (str) |
duplicate_slide | Duplicate a slide (copy inserted after original). Parameters: presentation_id (str), slide_id (str) |
move_slides | Reorder slides to a target position. Parameters: presentation_id (str), slide_ids (list[str]), insertion_index (int) |
insert_youtube_video | Embed 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_video | Embed 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.
| Function | Description |
|---|---|
delete_presentation | Permanently delete a presentation via Drive API. Parameters: presentation_id (str) |
delete_slide | Remove 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:
| Example | What it demonstrates |
|---|---|
basic.py | Create a presentation and add slides with layouts |
content_reader.py | Read slide text and fetch slide thumbnails |
presentation_builder.py | Build a multi-slide presentation with tables and text boxes |
media_slides.py | Embed YouTube and Drive videos and set background images |
Slide Layouts
The add_slide function supports the following Google Slides predefined layouts:
| Layout | Description |
|---|---|
BLANK | Empty slide |
TITLE | Title and subtitle |
TITLE_AND_BODY | Title with body text |
TITLE_AND_TWO_COLUMNS | Title with two body columns |
TITLE_ONLY | Title only, no body placeholder |
SECTION_HEADER | Large section header |
SECTION_TITLE_AND_DESCRIPTION | Section title with description |
ONE_COLUMN_TEXT | Single column of text |
MAIN_POINT | Large main point text |
BIG_NUMBER | Large number display |
CAPTION_ONLY | Caption 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.