Skip to content

Conversation

@yakiv07
Copy link

@yakiv07 yakiv07 commented Oct 18, 2025

Adds the ability to create Google Docs in specific folders (My Drive or Shared Drives) with automatic folder creation if needed.

Key Features

  • ✅ Create docs in folders by ID or name
  • ✅ Auto-create folders if they don't exist
  • ✅ Support for Shared Drives (Team Drives)
  • ✅ Direct folder placement using Drive API
  • ✅ New folder management tools

Changes

  • Enhanced create_doc function with folder_id and folder_name parameters
  • Added find_or_create_folder helper in drive_helpers.py
  • Added create_drive_folder and search_drive_folders tools
  • Proper Shared Drive support with supportsAllDrives=True

- Add folder_id and folder_name parameters to create_doc function
- Support both My Drive and Shared Drives (Team Drives)
- Add find_or_create_folder helper function in drive_helpers.py
- Add create_drive_folder and search_drive_folders tools
- Create documents directly in specified folders using Drive API
- Proper error handling and logging for folder operations
- Support for supportsAllDrives parameter for Shared Drives
@taylorwilsdon taylorwilsdon requested review from Copilot and taylorwilsdon and removed request for taylorwilsdon October 18, 2025 18:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive folder support to Google Docs creation, enabling users to create documents in specific folders within My Drive or Shared Drives, with automatic folder creation when needed.

Key changes:

  • Enhanced document creation with folder placement capabilities
  • Added folder management utilities for finding, creating, and searching folders
  • Implemented proper Shared Drive support with Drive API integration

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
gdrive/drive_helpers.py Added find_or_create_folder async function for folder discovery and creation with Shared Drive support
gdocs/docs_tools.py Enhanced create_doc with folder parameters, added create_drive_folder and search_drive_folders tools

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

include_items_from_all_drives: Whether to include items from all drives when searching
Returns:
str: Folder ID if found/created, None if failed
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type annotation in the function signature shows str but the docstring and implementation can return None. The return type should be Optional[str] to accurately reflect the possible return values.

Copilot uses AI. Check for mistakes.
@taylorwilsdon
Copy link
Owner

I like this, appreciate the PR! Looks like it would close #236 as well. Little less sure about the value of search within folder, since you should already be able to do that with the base search drive file. We're at the point of saturating small model context windows based on the sheer number of tool descriptions if users don't exclude certain tools or leverage the tool tiers, so I'm trying to balance nice to have functionality against keeping bloat down :D

Let me know if you're game to drop the search part @yakiv07 happy to get this merged

@taylorwilsdon taylorwilsdon self-requested a review October 22, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants