task icon Task

Find Files in Drive

Search Google Drive for files by name or description

Requirements
What to search for (file name, description, or content keywords). Optionally: file type (spreadsheet, document, presentation, etc.)
1

First, verify Google Drive is connected.

Check if the google_drive connection is established. If not, use connect_account
to establish it before proceeding. The user needs to authorize Drive access.

2

Run codeFind Files in Drive with:

  • arg1: Search terms from the user's description
  • arg2: The output path from stateDrive Search Results
  • arg3: MIME type filter if user specified a file type:
    • Spreadsheets: "application/vnd.google-apps.spreadsheet"
    • Documents: "application/vnd.google-apps.document"
    • Presentations: "application/vnd.google-apps.presentation"
    • Folders: "application/vnd.google-apps.folder"
    • PDFs: "application/pdf"
    • Leave empty for all file types
  • arg4: Max results (default 10)
4

Review the search results.

If files found: Present them to the user with name, type, and last modified date.
If this task was called by another task, return the results for further processing.

If no files found: Tell the user and suggest:

  • Trying different search terms
  • Checking if the file might be in a shared drive
  • Verifying the file name spelling
                    To run this task you must have the following required information:

> What to search for (file name, description, or content keywords).
Optionally: file type (spreadsheet, document, presentation, etc.)

If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.

---

You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.

Add all steps to your todo list now and begin executing.

## Steps

1. **First, verify Google Drive is connected.**

Check if the google_drive connection is established. If not, use connect_account
to establish it before proceeding. The user needs to authorize Drive access.


2. Run `skills/sauna/[skill_id]/scripts/drive.files.find.js` with:
- arg1: Search terms from the user's description
- arg2: The output path from `session/drive_results.json`
- arg3: MIME type filter if user specified a file type:
  - Spreadsheets: "application/vnd.google-apps.spreadsheet"
  - Documents: "application/vnd.google-apps.document"
  - Presentations: "application/vnd.google-apps.presentation"
  - Folders: "application/vnd.google-apps.folder"
  - PDFs: "application/pdf"
  - Leave empty for all file types
- arg4: Max results (default 10)


3. [Read Drive Search Results]: Read the file at `session/drive_results.json` into context

4. Review the search results.

**If files found:** Present them to the user with name, type, and last modified date.
If this task was called by another task, return the results for further processing.

**If no files found:** Tell the user and suggest:
- Trying different search terms
- Checking if the file might be in a shared drive
- Verifying the file name spelling