Automate Presentations with the Google Slides Skill: Create Decks from Your AI Agent
Ever wish you could generate presentations without leaving your terminal? The Google Slides skill brings the power of Google's presentation API to your Clawdbot agent, letting you create decks, add slides, insert content, and style text鈥攁ll through simple API calls.
What Problem Does This Solve?
Creating presentations manually is time-consuming. Whether you're preparing weekly reports, client proposals, or educational content, the process usually involves:
- Opening Google Slides
- Creating a new deck
- Adding slides one by one
- Formatting text and inserting images
The Google Slides skill automates all of this. Your AI agent can now generate entire presentations programmatically鈥攑erfect for:
- Automated reporting: Generate weekly/monthly report decks from data
- Template-based decks: Fill in placeholders across hundreds of slides
- Content workflows: Turn structured data into visual presentations
- Batch operations: Update multiple presentations at once
Installation
Getting started is straightforward:
npx clawhub@latest install google-slidesPrerequisites
You'll need a Maton API key for OAuth authentication. Here's how to get one:
- Visit maton.ai and sign in (or create an account)
- Go to maton.ai/settings
- Copy your API key
Set the key in your environment:
export MATON_API_KEY="your_api_key_here"Connect Your Google Account
Before making API calls, connect your Google account:
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'google-slides'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
result = json.load(urllib.request.urlopen(req))
print(f"Open this URL to authorize: {result['connection']['url']}")
EOFClick the URL to complete OAuth鈥攖his grants the skill access to your Google Slides.
Usage Examples
Example 1: Create a New Presentation
import requests, os
headers = {
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'Content-Type': 'application/json'
}
# Create the deck
response = requests.post(
'https://gateway.maton.ai/google-slides/v1/presentations',
headers=headers,
json={'title': 'Q1 Performance Review'}
)
presentation = response.json()
print(f"Created: {presentation['presentationId']}")Example 2: Add Slides with Different Layouts
presentation_id = "your_presentation_id"
# Add a title slide and a content slide
requests.post(
f'https://gateway.maton.ai/google-slides/v1/presentations/{presentation_id}:batchUpdate',
headers=headers,
json={
'requests': [
{'createSlide': {'slideLayoutReference': {'predefinedLayout': 'TITLE'}}},
{'createSlide': {'slideLayoutReference': {'predefinedLayout': 'TITLE_AND_BODY'}}}
]
}
)Available layouts include: BLANK, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, SECTION_HEADER, MAIN_POINT, BIG_NUMBER, and more.
Example 3: Template-Based Generation
The replaceAllText feature is powerful for template workflows:
# Replace placeholders across the entire deck
requests.post(
f'https://gateway.maton.ai/google-slides/v1/presentations/{presentation_id}:batchUpdate',
headers=headers,
json={
'requests': [
{'replaceAllText': {'containsText': {'text': '{{company}}'}, 'replaceText': 'Acme Corp'}},
{'replaceAllText': {'containsText': {'text': '{{date}}'}, 'replaceText': 'February 2026'}},
{'replaceAllText': {'containsText': {'text': '{{revenue}}'}, 'replaceText': '$1.2M'}}
]
}
)Create a template once, then fill it programmatically for each client or report period.
Tips & Best Practices
-
Object IDs must be unique within a presentation. Use meaningful prefixes like
slide_001,shape_header_1to keep things organized. -
Batch your updates: The
batchUpdateendpoint applies all requests atomically. Group related changes together for better performance. -
Sizes use points (PT): 72 points = 1 inch. Keep this in mind when positioning shapes and images.
-
Handle multiple Google accounts: If you have several connected accounts, specify which one to use with the
Maton-Connectionheader. -
Error 429 = rate limited: Maton allows 10 requests/second per account. Build in retry logic for bulk operations.
Conclusion
The Google Slides skill transforms your AI agent into a presentation generator. Whether you're automating reports, filling templates, or building content pipelines, this skill handles the heavy lifting while you focus on the content.
Links:
Comments (0)
No comments yet. Be the first to comment!