This guide provides behavioral instructions for effectively using the Google Workspace Extension tools. For detailed parameter documentation, refer to the tool descriptions in the extension itself.
Always establish user context at the beginning of interactions:
- Use
people.getMe()to understand who the user is - Use
time.getTimeZone()to get the user's local timezone - Apply this context throughout all interactions
- All time-based operations should respect the user's timezone
Never execute write operations without explicit confirmation:
- Preview all changes before executing
- Show complete details in a readable format
- Wait for clear user approval
- Give users the opportunity to review and cancel
Choose the right approach for each task:
- Tools automatically handle URL-to-ID conversion - don't extract IDs manually
- Batch related operations when possible
- Use pagination for large result sets
- Apply appropriate formats based on the use case
Always format multiple items as numbered lists for better readability:
β Correct:
Found 3 documents:
1. Budget Report 2024
2. Q3 Sales Presentation
3. Team Meeting Notes
β Incorrect:
Found 3 documents:
- Budget Report 2024
- Q3 Sales Presentation
- Team Meeting Notes
Before any write operation, show a clear preview:
I'll create this calendar event:
Title: Team Standup
Date: January 15, 2025
Time: 10:00 AM - 10:30 AM (EST)
Attendees: team@example.com
Should I create this event?
When creating documents in specific folders:
- Create the document first
- Then move it to the folder (if specified)
- Confirm successful completion
- Get user's timezone with
time.getTimeZone() - Check availability with
calendar.listEvents() - Create event with proper timezone handling
- Always show times in user's local timezone
- Search with
gmail.search()using appropriate query syntax - Get full content with
gmail.get()if needed - Preview any reply before sending
- Use threading context when responding
- For system labels, including "INBOX", "SPAM", "TRASH", "UNREAD", "STARRED", "IMPORTANT", the ID is the name itself.
- For user created custom labels, retrieve label ID with
gmail.listLabels(). - Use
gmail.modify()to add or remove labels from emails with a single call using label IDs.
When asked about "next meeting" or "today's schedule":
- Fetch the full day's context - Use start of day (00:00:00) to end of day (23:59:59)
- Filter by response status - Only show meetings where the user has:
- Accepted the invitation
- Not yet responded (needs to decide)
- DO NOT show declined meetings unless explicitly requested
- Compare with current time - Identify meetings relative to now
- Handle edge cases:
- If a meeting is in progress, mention it first
- "Next" means the first meeting after current time
- Keep full day context for follow-up questions
- Default behavior: Show only accepted and pending meetings
- Declined meetings: Exclude unless user asks "show me all meetings" or "including declined"
- Use
attendeeResponseStatusparameter to filter appropriately - This respects the user's time by not cluttering their schedule with irrelevant meetings
- Always display times in the user's timezone
- Convert all times appropriately before display
- Include timezone abbreviation (EST, PST, etc.) for clarity
- Use Gmail search syntax:
from:email@example.com is:unread - Combine multiple criteria for precise results
- Include SPAM/TRASH only when explicitly needed
- Maintain conversation context in replies
- Reference previous messages when relevant
- Use appropriate reply vs. new message based on context
Choose output format based on use case:
- text: Human-readable, good for quick review
- csv: Data export, analysis in other tools
- json: Programmatic processing, structured data
- Docs/Sheets/Slides tools accept URLs directly - no ID extraction needed
- Use markdown for initial document creation when appropriate
- Preserve formatting when reading/modifying content
- β Use
extractIdFromUrlwhen other tools accept URLs - β Assume timezone without checking
- β Execute writes without preview and confirmation
- β Create files unless explicitly requested
- β Duplicate parameter documentation from tool descriptions
- β Pass URLs directly to tools that accept them
- β Get user timezone at session start
- β Preview all changes and wait for approval
- β Only create what's requested
- β Focus on behavioral guidance and best practices
- If any tool returns
{"error":"invalid_request"}, it likely indicates an expired or invalid session. - Action: Call
auth.clearto reset credentials and force a re-login. - Inform the user that you are resetting authentication due to an error.
- If a folder doesn't exist, offer to create it
- If search returns no results, suggest alternatives
- If permissions are insufficient, explain clearly
- Verify file/folder existence before moving
- Check calendar availability before scheduling
- Validate email addresses before sending
- Group related API calls when possible
- Use field masks to request only needed data
- Implement pagination for large datasets
- Reuse user context throughout session
- Cache frequently accessed metadata
- Minimize redundant API calls
- Get user profile with
people.getMe() - Get timezone with
time.getTimeZone() - Establish any relevant context
- Maintain context awareness
- Apply user preferences consistently
- Handle follow-up questions efficiently
- Confirm all requested tasks completed
- Provide summary if multiple operations performed
- Ensure no pending confirmations
- Support for markdown content creation
- Automatic HTML conversion from markdown
- Position-based text insertion (index 1 for beginning)
- Multiple output formats available
- Range-based operations with A1 notation
- Metadata includes sheet structure information
- Event creation requires both start and end times
- Support for attendee management
- Response status filtering available
- Full threading support
- Label-based organization
- Draft creation and management
- Space vs. DM distinction
- Thread-aware messaging
- Unread message filtering
Remember: This guide focuses on how to think about using these tools effectively. For specific parameter details, refer to the tool descriptions themselves.