# Google Drive

## Links

- Product page URL: https://www.agentpmt.com/marketplace/google-drive
- Product markdown URL: https://www.agentpmt.com/marketplace/google-drive?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/google-drive?format=agent-json

## Overview

- Product ID: 697bb62731d2bd755ac04037
- Vendor: Apoth3osis
- Type: function
- Unit type: request
- Price: 500 credits
- Categories: Data Storage & Persistence, Automation, File & Binary Operations, Content Management & Publishing, Team Collaboration & Workspaces, Document Processing & OCR
- Generated at: 2026-04-15T18:20:37.869Z

### Page Description

Give your AI agent access to Google Drive for seamless file management, organization, and collaboration. Search across your Drive to find files by name or content, download files to AgentPMT storage for processing, and upload new files back to Drive from AgentPMT storage or public URLs. Create folder structures with automatic path creation, move and copy files between folders, and manage sharing permissions to collaborate with others. Export Google Docs, Sheets, and Slides to formats like PDF, DOCX, or XLSX. This tool is essential for agents that need to work with documents stored in Drive, automate file organization, sync content between systems, or manage document workflows. All operations run securely through your connected Google OAuth account with support for both personal Drive and shared drives.

### Agent Description

Google Drive file management: search, upload, download, organize folders, move/copy files, share with permissions, and export Google Docs formats.

## Details Tab

### Details

Give your AI agent access to Google Drive for seamless file management, organization, and collaboration. Search across your Drive to find files by name or content, download files to AgentPMT storage for processing, and upload new files back to Drive from AgentPMT storage or public URLs. Create folder structures with automatic path creation, move and copy files between folders, and manage sharing permissions to collaborate with others. Export Google Docs, Sheets, and Slides to formats like PDF, DOCX, or XLSX. This tool is essential for agents that need to work with documents stored in Drive, automate file organization, sync content between systems, or manage document workflows. All operations run securely through your connected Google OAuth account with support for both personal Drive and shared drives.

### Actions

- `search_files` (5 credits): Search for files and folders in Google Drive by text, MIME type, or folder location.
- `get_file_metadata` (5 credits): Retrieve metadata for a specific file or folder.
- `download_file_to_storage` (5 credits): Download a file from Drive and store it in temporary AgentPMT storage. Google Docs/Sheets/Slides are automatically exported (Docs to PDF, Sheets to XLSX, Slides to PPTX by default).
- `upload_file_from_storage` (5 credits): Upload a file into Google Drive. Provide exactly one source: source_content_base64 (requires filename), source_file_url, or source_file_id. Local file paths are NOT supported.
- `create_folder` (5 credits): Create a new folder in Google Drive.
- `ensure_folder_path` (5 credits): Ensure a full folder path exists, creating any missing segments. Returns the final folder ID.
- `move_file` (5 credits): Move a file or folder to a different location in Google Drive.
- `copy_file` (5 credits): Create a copy of a file in Google Drive.
- `trash_file` (5 credits): Move a file or folder to the trash (recoverable).
- `delete_file` (5 credits): Permanently delete a file or folder (not recoverable).
- `share_file` (5 credits): Share a file or folder by creating a permission.
- `list_permissions` (5 credits): List all permissions on a file or folder.

### Use Cases

Search Drive files by name or content, Download files to AgentPMT storage for processing, Upload files to Drive from AgentPMT storage, Create folder structures and organize files, Move and copy files between folders, Share files and manage permissions, Export Google Docs to PDF or DOCX, Sync files between Drive and other systems, Automate document organization workflows, Manage shared drive content

### Workflows Using This Tool

No public workflows currently reference this product.

### Related Content

No related content is currently linked to this product.

## Advanced Tab

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

STDIO connector for Claude Code, Codex, Cursor, Zed, and other LLMs that require STDIO or custom connections. This lightweight connector routes requests to `https://api.agentpmt.com/mcp`. All tool execution happens in the cloud and the server cannot edit any files on your computer.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "697bb62731d2bd755ac04037",
    "parameters": {
      "action": "search_files",
      "trashed": false,
      "page_size": 25,
      "order_by": "modifiedTime desc",
      "include_shared_drives": true
    }
  }'
```

### Autonomous Agents

Do not use the abbreviated instructions in this product markdown for wallet-based invocation. Retrieve the full External Agent API markdown document instead.

- External Agent API page URL: https://www.agentpmt.com/external-agent-api
- External Agent API markdown URL: https://www.agentpmt.com/external-agent-api?format=agent-md

### Schema

#### Credentials

These runtime credentials should be provided under `parameters._credentials` when required.

- Google OAuth (`google_oauth`, oauth_token, required)
  Help: Connect your Google account.
  Connection ID: 69616abea90ed54743f01957

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "search_files": {
      "description": "Search for files and folders in Google Drive by text, MIME type, or folder location.",
      "properties": {
        "query": {
          "type": "string",
          "description": "Plain-text search matched against full text and file name",
          "required": false
        },
        "raw_query": {
          "type": "string",
          "description": "Advanced Drive query string (q=...). If provided, overrides query and other filters.",
          "required": false
        },
        "mime_type": {
          "type": "string",
          "description": "Filter by MIME type. Accepts aliases: folder, document, spreadsheet, presentation, drawing. Or a full MIME type string.",
          "required": false
        },
        "folder_id": {
          "type": "string",
          "description": "Restrict to a specific folder by ID. Use 'root' for My Drive root.",
          "required": false
        },
        "folder_path": {
          "type": "string",
          "description": "Restrict to a folder by path (e.g., 'Projects/Client A'), resolved under folder_id or root.",
          "required": false
        },
        "trashed": {
          "type": "boolean",
          "description": "If true, include trashed items (default false)",
          "required": false,
          "default": false
        },
        "page_size": {
          "type": "integer",
          "description": "Max results per page (default 25, max 1000)",
          "required": false,
          "default": 25,
          "minimum": 1,
          "maximum": 1000
        },
        "page_token": {
          "type": "string",
          "description": "Pagination token from a previous response",
          "required": false
        },
        "order_by": {
          "type": "string",
          "description": "Drive orderBy string (default 'modifiedTime desc')",
          "required": false,
          "default": "modifiedTime desc"
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include items from shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "get_file_metadata": {
      "description": "Retrieve metadata for a specific file or folder.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "Drive file or folder ID",
          "required": true
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "download_file_to_storage": {
      "description": "Download a file from Drive and store it in temporary AgentPMT storage. Google Docs/Sheets/Slides are automatically exported (Docs to PDF, Sheets to XLSX, Slides to PPTX by default).",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "Drive file ID to download",
          "required": true
        },
        "export_format": {
          "type": "string",
          "description": "Override export format for Google Workspace files",
          "required": false,
          "enum": [
            "pdf",
            "txt",
            "html",
            "docx",
            "xlsx",
            "pptx",
            "odt",
            "rtf",
            "epub",
            "zip",
            "csv",
            "tsv"
          ]
        },
        "output_filename": {
          "type": "string",
          "description": "Override the stored filename",
          "required": false
        },
        "max_bytes": {
          "type": "integer",
          "description": "Safety limit for download size in bytes (default 25 MiB, max 250 MiB)",
          "required": false,
          "default": 26214400,
          "minimum": 1,
          "maximum": 262144000
        },
        "expiration_days": {
          "type": "integer",
          "description": "Days until the stored file expires (default 7, range 1-7)",
          "required": false,
          "default": 7,
          "minimum": 1,
          "maximum": 7
        },
        "acknowledge_abuse": {
          "type": "boolean",
          "description": "Allow downloading files flagged as abusive (non-Google files only, default false)",
          "required": false,
          "default": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "upload_file_from_storage": {
      "description": "Upload a file into Google Drive. Provide exactly one source: source_content_base64 (requires filename), source_file_url, or source_file_id. Local file paths are NOT supported.",
      "properties": {
        "source_file_id": {
          "type": "string",
          "description": "AgentPMT storage file_id to upload into Drive",
          "required": false
        },
        "source_file_url": {
          "type": "string",
          "description": "Public URL to fetch and upload into Drive",
          "required": false
        },
        "source_content_base64": {
          "type": "string",
          "description": "Base64-encoded content to upload into Drive",
          "required": false
        },
        "filename": {
          "type": "string",
          "description": "Filename for the uploaded file (required with source_content_base64, optional otherwise)",
          "required": false
        },
        "content_type": {
          "type": "string",
          "description": "MIME type override for upload (inferred from filename if omitted)",
          "required": false
        },
        "parent_folder_id": {
          "type": "string",
          "description": "Destination folder ID (provide only one of parent_folder_id or parent_folder_path)",
          "required": false
        },
        "parent_folder_path": {
          "type": "string",
          "description": "Destination folder path (e.g., 'Projects/Reports')",
          "required": false
        },
        "create_parent_folders": {
          "type": "boolean",
          "description": "Auto-create missing folders in parent_folder_path (default false)",
          "required": false,
          "default": false
        },
        "folder_id": {
          "type": "string",
          "description": "Root context for resolving parent_folder_path (defaults to My Drive root)",
          "required": false
        },
        "max_upload_bytes": {
          "type": "integer",
          "description": "Safety limit for upload size in bytes (default 25 MiB, max 250 MiB)",
          "required": false,
          "default": 26214400,
          "minimum": 1,
          "maximum": 262144000
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "create_folder": {
      "description": "Create a new folder in Google Drive.",
      "properties": {
        "folder_name": {
          "type": "string",
          "description": "Name of the new folder",
          "required": true
        },
        "parent_folder_id": {
          "type": "string",
          "description": "Parent folder ID (provide only one of parent_folder_id or parent_folder_path)",
          "required": false
        },
        "parent_folder_path": {
          "type": "string",
          "description": "Parent folder path",
          "required": false
        },
        "create_parent_folders": {
          "type": "boolean",
          "description": "Auto-create missing parent folders (default false)",
          "required": false,
          "default": false
        },
        "folder_id": {
          "type": "string",
          "description": "Root context for resolving parent_folder_path (defaults to My Drive root)",
          "required": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "ensure_folder_path": {
      "description": "Ensure a full folder path exists, creating any missing segments. Returns the final folder ID.",
      "properties": {
        "ensure_path": {
          "type": "string",
          "description": "Folder path to ensure (e.g., 'Projects/Client A/Deliverables')",
          "required": true
        },
        "folder_id": {
          "type": "string",
          "description": "Root folder ID to resolve path under (defaults to My Drive root)",
          "required": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "move_file": {
      "description": "Move a file or folder to a different location in Google Drive.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file or folder ID to move",
          "required": true
        },
        "destination_folder_id": {
          "type": "string",
          "description": "Destination folder ID (provide only one of destination_folder_id or destination_folder_path)",
          "required": false
        },
        "destination_folder_path": {
          "type": "string",
          "description": "Destination folder path",
          "required": false
        },
        "remove_existing_parents": {
          "type": "boolean",
          "description": "Remove the file from its current parent(s) (default true). If false, destination is added as an additional parent.",
          "required": false,
          "default": true
        },
        "create_parent_folders": {
          "type": "boolean",
          "description": "Auto-create missing folders in destination_folder_path (default false)",
          "required": false,
          "default": false
        },
        "folder_id": {
          "type": "string",
          "description": "Root context for resolving destination_folder_path",
          "required": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "copy_file": {
      "description": "Create a copy of a file in Google Drive.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file ID to copy",
          "required": true
        },
        "new_name": {
          "type": "string",
          "description": "Name for the copy",
          "required": false
        },
        "parent_folder_id": {
          "type": "string",
          "description": "Destination folder ID (provide only one of parent_folder_id or parent_folder_path)",
          "required": false
        },
        "parent_folder_path": {
          "type": "string",
          "description": "Destination folder path",
          "required": false
        },
        "create_parent_folders": {
          "type": "boolean",
          "description": "Auto-create missing folders (default false)",
          "required": false,
          "default": false
        },
        "folder_id": {
          "type": "string",
          "description": "Root context for resolving parent_folder_path",
          "required": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "trash_file": {
      "description": "Move a file or folder to the trash (recoverable).",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file or folder ID to trash",
          "required": true
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "delete_file": {
      "description": "Permanently delete a file or folder (not recoverable).",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file or folder ID to permanently delete",
          "required": true
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "share_file": {
      "description": "Share a file or folder by creating a permission.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file or folder ID to share",
          "required": true
        },
        "permission": {
          "type": "object",
          "description": "Permission details",
          "required": true,
          "properties": {
            "permission_type": {
              "type": "string",
              "description": "Permission type",
              "required": true,
              "enum": [
                "user",
                "group",
                "domain",
                "anyone"
              ]
            },
            "role": {
              "type": "string",
              "description": "Permission role",
              "required": true,
              "enum": [
                "reader",
                "commenter",
                "writer",
                "organizer",
                "fileOrganizer"
              ]
            },
            "email": {
              "type": "string",
              "description": "Email for user/group permissions. Also accepts emailAddress as alias.",
              "required": false
            },
            "domain": {
              "type": "string",
              "description": "Domain for domain-type permissions",
              "required": false
            },
            "allow_file_discovery": {
              "type": "boolean",
              "description": "For anyone/domain types, allow discovery via search (default false)",
              "required": false,
              "default": false
            }
          }
        },
        "send_notification": {
          "type": "boolean",
          "description": "Send email notification for user/group shares (default true)",
          "required": false,
          "default": true
        },
        "email_message": {
          "type": "string",
          "description": "Custom message in the notification email",
          "required": false
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    },
    "list_permissions": {
      "description": "List all permissions on a file or folder.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "The file or folder ID",
          "required": true
        },
        "include_shared_drives": {
          "type": "boolean",
          "description": "Include shared drives (default true)",
          "required": false,
          "default": true
        }
      }
    }
  },
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "get_instructions",
        "search_files",
        "get_file_metadata",
        "download_file_to_storage",
        "upload_file_from_storage",
        "create_folder",
        "ensure_folder_path",
        "move_file",
        "copy_file",
        "trash_file",
        "delete_file",
        "share_file",
        "list_permissions"
      ],
      "description": "Action to perform",
      "required": false
    },
    "file_id": {
      "type": "string",
      "description": "Drive file/folder ID",
      "required": false
    },
    "folder_id": {
      "type": "string",
      "description": "Drive folder ID (use 'root' for My Drive)",
      "required": false
    },
    "folder_path": {
      "type": "string",
      "description": "Folder path like 'Projects/Client A' (resolved under folder_id or 'root').",
      "required": false
    },
    "query": {
      "type": "string",
      "description": "Plain-text search (matched against full text and name).",
      "required": false
    },
    "raw_query": {
      "type": "string",
      "description": "Advanced Drive query string (q=...). If provided, used directly.",
      "required": false
    },
    "mime_type": {
      "type": "string",
      "description": "Filter by mimeType. Friendly aliases: 'folder', 'document', 'spreadsheet', 'presentation', 'drawing'. Or use a full MIME type string.",
      "required": false
    },
    "trashed": {
      "type": "boolean",
      "default": false,
      "description": "If true, include trashed items (default false)",
      "required": false
    },
    "page_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000,
      "default": 25,
      "description": "Max results per page (default 25, max 1000)",
      "required": false
    },
    "page_token": {
      "type": "string",
      "description": "Pagination token from previous response",
      "required": false
    },
    "order_by": {
      "type": "string",
      "default": "modifiedTime desc",
      "description": "Drive orderBy string",
      "required": false
    },
    "export_format": {
      "type": "string",
      "enum": [
        "pdf",
        "txt",
        "html",
        "docx",
        "xlsx",
        "pptx",
        "odt",
        "rtf",
        "epub",
        "zip",
        "csv",
        "tsv"
      ],
      "description": "For Google Docs/Sheets/Slides types, export format.",
      "required": false
    },
    "acknowledge_abuse": {
      "type": "boolean",
      "default": false,
      "description": "Allow downloading abusive files (non-Google files only).",
      "required": false
    },
    "max_bytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 262144000,
      "default": 26214400,
      "description": "Safety limit for downloads in bytes (default 25MiB, max 250MiB).",
      "required": false
    },
    "expiration_days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7,
      "default": 7,
      "description": "Days until stored download expires (1-7).",
      "required": false
    },
    "output_filename": {
      "type": "string",
      "description": "Override filename when storing the downloaded content.",
      "required": false
    },
    "source_file_id": {
      "type": "string",
      "description": "AgentPMT storage file_id to upload into Drive",
      "required": false
    },
    "source_file_url": {
      "type": "string",
      "description": "Public URL to fetch and upload into Drive",
      "required": false
    },
    "source_content_base64": {
      "type": "string",
      "description": "Base64-encoded content to upload into Drive",
      "required": false
    },
    "filename": {
      "type": "string",
      "description": "Filename to use for upload (required if using source_content_base64)",
      "required": false
    },
    "content_type": {
      "type": "string",
      "description": "MIME type override for upload (optional)",
      "required": false
    },
    "parent_folder_id": {
      "type": "string",
      "description": "Destination folder ID for uploads/copies/creates",
      "required": false
    },
    "parent_folder_path": {
      "type": "string",
      "description": "Destination folder path for uploads/copies/creates",
      "required": false
    },
    "create_parent_folders": {
      "type": "boolean",
      "default": false,
      "description": "If true and parent_folder_path is provided, create missing folders.",
      "required": false
    },
    "max_upload_bytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 262144000,
      "default": 26214400,
      "description": "Safety limit for uploads in bytes (default 25MiB, max 250MiB).",
      "required": false
    },
    "folder_name": {
      "type": "string",
      "description": "Folder name for create_folder",
      "required": false
    },
    "ensure_path": {
      "type": "string",
      "description": "Folder path to ensure for ensure_folder_path",
      "required": false
    },
    "destination_folder_id": {
      "type": "string",
      "description": "Destination folder ID for move_file",
      "required": false
    },
    "destination_folder_path": {
      "type": "string",
      "description": "Destination folder path for move_file",
      "required": false
    },
    "remove_existing_parents": {
      "type": "boolean",
      "default": true,
      "description": "If true, remove current parents when moving (default true).",
      "required": false
    },
    "new_name": {
      "type": "string",
      "description": "Optional new name for copy_file",
      "required": false
    },
    "permission": {
      "type": "object",
      "description": "Permission details for share_file. Use 'email' (or 'emailAddress') for user/group types.",
      "properties": {
        "permission_type": {
          "type": "string",
          "enum": [
            "user",
            "group",
            "domain",
            "anyone"
          ],
          "required": false,
          "description": ""
        },
        "role": {
          "type": "string",
          "enum": [
            "reader",
            "commenter",
            "writer",
            "organizer",
            "fileOrganizer"
          ],
          "required": false,
          "description": ""
        },
        "email": {
          "type": "string",
          "description": "Email for user/group permissions.",
          "required": false
        },
        "domain": {
          "type": "string",
          "required": false,
          "description": ""
        },
        "allow_file_discovery": {
          "type": "boolean",
          "default": false,
          "required": false,
          "description": ""
        }
      },
      "required": false
    },
    "send_notification": {
      "type": "boolean",
      "default": true,
      "description": "Send email notification for user/group shares.",
      "required": false
    },
    "email_message": {
      "type": "string",
      "description": "Optional email message for share notification",
      "required": false
    },
    "include_shared_drives": {
      "type": "boolean",
      "default": true,
      "description": "Include shared drives and items from all drives where possible.",
      "required": false
    }
  }
}
```

### Usage Instructions

# Google Drive

## Overview
Search, upload, download, organize, and share Google Drive files and folders. Supports My Drive and shared drives, folder path resolution, file export/conversion, and permission management.

## Actions

### search_files
Search for files and folders in Google Drive by text, MIME type, or folder location.

**Required fields:** None (returns all non-trashed files by default)

**Optional fields:**
- `query` (string) - Plain-text search matched against full text and file name
- `raw_query` (string) - Advanced Drive query string (used directly as the `q` parameter). If provided, overrides `query` and other filters
- `mime_type` (string) - Filter by MIME type. Accepts aliases: `folder`, `document`, `spreadsheet`, `presentation`, `drawing`, or a full MIME type string
- `folder_id` (string) - Restrict to a specific folder by ID. Use `"root"` for My Drive root
- `folder_path` (string) - Restrict to a folder by path (e.g., `"Projects/Client A"`), resolved under `folder_id` or root
- `trashed` (boolean, default: false) - If true, include trashed items
- `page_size` (integer, default: 25, max: 1000) - Results per page
- `page_token` (string) - Pagination token from a previous response's `next_page_token`
- `order_by` (string, default: `"modifiedTime desc"`) - Sort order
- `include_shared_drives` (boolean, default: true) - Include items from shared drives

```json
{
  "action": "search_files",
  "query": "quarterly report",
  "mime_type": "document",
  "page_size": 10
}
```

```json
{
  "action": "search_files",
  "folder_path": "Finance/2026",
  "mime_type": "spreadsheet"
}
```

```json
{
  "action": "search_files",
  "raw_query": "mimeType='application/pdf' and modifiedTime > '2026-01-01T00:00:00'"
}
```

### get_file_metadata
Retrieve metadata for a specific file or folder.

**Required fields:**
- `file_id` (string) - The Drive file or folder ID

```json
{
  "action": "get_file_metadata",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms"
}
```

### download_file_to_storage
Download a file from Drive and store it in temporary storage. Google Docs/Sheets/Slides are automatically exported (Docs to PDF, Sheets to XLSX, Slides to PPTX by default).

**Required fields:**
- `file_id` (string) - The Drive file ID

**Optional fields:**
- `export_format` (string, enum: `pdf`, `txt`, `html`, `docx`, `xlsx`, `pptx`, `odt`, `rtf`, `epub`, `zip`, `csv`, `tsv`) - Override the export format for Google Workspace files
- `output_filename` (string) - Override the stored filename
- `max_bytes` (integer, default: 26214400 / 25 MiB, max: 262144000 / 250 MiB) - Safety limit for download size
- `expiration_days` (integer, default: 7, range: 1-7) - Days until the stored file expires
- `acknowledge_abuse` (boolean, default: false) - Allow downloading files flagged as abusive (non-Google files only)

```json
{
  "action": "download_file_to_storage",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "export_format": "docx"
}
```

```json
{
  "action": "download_file_to_storage",
  "file_id": "1abc123def456",
  "output_filename": "invoice_march.pdf",
  "expiration_days": 3
}
```

### upload_file_from_storage
Upload a file into Google Drive. Provide exactly one source. Files under 10 MiB use multipart upload; larger files use resumable upload automatically.

**Required fields (exactly one):**
- `source_content_base64` (string) - Base64-encoded file content. **Requires `filename`**
- `source_file_url` (string) - Public URL to fetch content from
- `source_file_id` (string) - File ID from AgentPMT storage (from a previous download or upload)

**Optional fields:**
- `filename` (string) - Filename for the uploaded file (required with `source_content_base64`, optional otherwise)
- `content_type` (string) - MIME type override (inferred from filename if omitted)
- `parent_folder_id` (string) - Destination folder ID (provide only one of `parent_folder_id` or `parent_folder_path`)
- `parent_folder_path` (string) - Destination folder path (e.g., `"Projects/Reports"`)
- `create_parent_folders` (boolean, default: false) - Auto-create missing folders in `parent_folder_path`
- `max_upload_bytes` (integer, default: 26214400 / 25 MiB, max: 262144000 / 250 MiB) - Safety limit for upload size

**Local file paths are NOT supported.** You cannot pass a filesystem path.

```json
{
  "action": "upload_file_from_storage",
  "source_content_base64": "SGVsbG8gV29ybGQh",
  "filename": "greeting.txt",
  "parent_folder_path": "Documents/Notes",
  "create_parent_folders": true
}
```

```json
{
  "action": "upload_file_from_storage",
  "source_file_url": "https://example.com/report.pdf",
  "filename": "annual_report_2026.pdf",
  "parent_folder_id": "1AbCdEfGhIjKlMnOpQrStUvWxYz"
}
```

```json
{
  "action": "upload_file_from_storage",
  "source_file_id": "storage_abc123",
  "parent_folder_path": "Backups"
}
```

### create_folder
Create a new folder in Google Drive.

**Required fields:**
- `folder_name` (string) - Name of the new folder

**Optional fields:**
- `parent_folder_id` (string) - Parent folder ID (provide only one of `parent_folder_id` or `parent_folder_path`)
- `parent_folder_path` (string) - Parent folder path
- `create_parent_folders` (boolean, default: false) - Auto-create missing parent folders
- `folder_id` (string) - Root context for resolving `parent_folder_path` (defaults to My Drive root)

```json
{
  "action": "create_folder",
  "folder_name": "March Invoices",
  "parent_folder_path": "Finance/2026",
  "create_parent_folders": true
}
```

### ensure_folder_path
Ensure a full folder path exists, creating any missing segments. Returns the final folder ID.

**Required fields:**
- `ensure_path` (string) - Folder path to ensure (e.g., `"Projects/Client A/Deliverables"`)

**Optional fields:**
- `folder_id` (string) - Root folder ID to resolve path under (defaults to My Drive root)

```json
{
  "action": "ensure_folder_path",
  "ensure_path": "Projects/Client A/Deliverables/Q1"
}
```

### move_file
Move a file or folder to a different location.

**Required fields:**
- `file_id` (string) - The file or folder ID to move
- One of: `destination_folder_id` (string) or `destination_folder_path` (string)

**Optional fields:**
- `remove_existing_parents` (boolean, default: true) - If true, removes the file from its current parent(s). If false, the destination is added as an additional parent
- `create_parent_folders` (boolean, default: false) - Auto-create missing folders in `destination_folder_path`
- `folder_id` (string) - Root context for resolving `destination_folder_path`

```json
{
  "action": "move_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "destination_folder_path": "Archive/2025"
}
```

### copy_file
Create a copy of a file.

**Required fields:**
- `file_id` (string) - The file ID to copy

**Optional fields:**
- `new_name` (string) - Name for the copy
- `parent_folder_id` (string) - Destination folder ID (provide only one of `parent_folder_id` or `parent_folder_path`)
- `parent_folder_path` (string) - Destination folder path
- `create_parent_folders` (boolean, default: false) - Auto-create missing folders

```json
{
  "action": "copy_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "new_name": "Budget 2026 (Copy)",
  "parent_folder_path": "Finance/Templates"
}
```

### trash_file
Move a file or folder to the trash (recoverable).

**Required fields:**
- `file_id` (string) - The file or folder ID to trash

```json
{
  "action": "trash_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms"
}
```

### delete_file
Permanently delete a file or folder (not recoverable).

**Required fields:**
- `file_id` (string) - The file or folder ID to delete

```json
{
  "action": "delete_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms"
}
```

### share_file
Share a file or folder by creating a permission.

**Required fields:**
- `file_id` (string) - The file or folder ID to share
- `permission` (object) - Permission details:
  - `type` (string, enum: `user`, `group`, `domain`, `anyone`) - Permission type
  - `role` (string, enum: `reader`, `commenter`, `writer`, `organizer`, `fileOrganizer`) - Permission role
  - `email` (string) - Required for `user` or `group` types. Also accepts `emailAddress` as alias
  - `domain` (string) - Required for `domain` type
  - `allow_file_discovery` (boolean, default: false) - For `anyone`/`domain` types, allow discovery via search

**Optional fields:**
- `send_notification` (boolean, default: true) - Send email notification (only for `user`/`group` types)
- `email_message` (string) - Custom message in the notification email

```json
{
  "action": "share_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "permission": {
    "type": "user",
    "role": "writer",
    "email": "colleague@example.com"
  },
  "email_message": "Here is the project document for your review."
}
```

```json
{
  "action": "share_file",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "permission": {
    "type": "anyone",
    "role": "reader"
  },
  "send_notification": false
}
```

### list_permissions
List all permissions on a file or folder.

**Required fields:**
- `file_id` (string) - The file or folder ID

```json
{
  "action": "list_permissions",
  "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms"
}
```

## Common Workflows

### 1. Organize uploaded content into a folder structure
1. Use `ensure_folder_path` with `ensure_path: "Projects/Client B/Assets"` to create the full path
2. Use `upload_file_from_storage` with `source_file_url` or `source_content_base64` and set `parent_folder_path: "Projects/Client B/Assets"`
3. Use `share_file` to grant the client read access

### 2. Download a Google Doc, convert, and reshare
1. Use `search_files` with `query: "proposal draft"` and `mime_type: "document"` to find the file
2. Use `download_file_to_storage` with the `file_id` and `export_format: "docx"` to get a Word version
3. The returned storage file ID can be used with other tools or re-uploaded elsewhere

### 3. Archive old files to a subfolder
1. Use `search_files` with `folder_path: "Active Projects"` to list files
2. Use `ensure_folder_path` with `ensure_path: "Archive/2025"` to ensure the archive folder exists
3. Use `move_file` for each file, setting `destination_folder_path: "Archive/2025"`

## Important Notes
- **MIME type aliases:** Use `folder`, `document`, `spreadsheet`, `presentation`, or `drawing` instead of full MIME strings when filtering searches
- **Folder path resolution:** Paths use `/` separators (e.g., `"Projects/Client A/Reports"`). If a path segment matches multiple folders with the same name, the tool prefers the exact case match. If truly ambiguous, it returns candidate IDs so you can use the direct folder ID instead
- **Download size limits:** Default 25 MiB, max 250 MiB. Increase `max_bytes` for larger files
- **Upload size limits:** Default 25 MiB, max 250 MiB. Increase `max_upload_bytes` for larger files
- **Google Workspace exports:** Google Docs export to PDF by default, Sheets to XLSX, Slides to PPTX, Drawings to PDF. Override with `export_format`
- **Shared drives:** Included by default (`include_shared_drives: true`). Set to false to exclude
- **Trash vs delete:** `trash_file` is recoverable; `delete_file` is permanent
- **Upload sources:** Provide exactly one of `source_file_id`, `source_file_url`, or `source_content_base64`. Local filesystem paths are not supported
- **Downloaded files are stored temporarily** and expire after `expiration_days` (default 7, max 7)
- **Pagination:** When results exceed `page_size`, the response includes `next_page_token`. Pass it as `page_token` in the next request to get the next page

### About The Developer

- Vendor name: Apoth3osis
- Website: apoth3osis.io

We build tools that enable AI agents to excel in the mathematical realm.

Our small team develops experimental and unique solutions in the AI arena, with a strong focus on modular computing for agentic applications and custom model deployment. We have handled projects for a variety of applications across many sectors, from algorithmic trading and financial analysis, to molecular simulations and predictions, to habitat and biodiversity monitoring and wildlife conservation.

### Frequently Asked Questions

No linked FAQs are currently available.

### Dependencies

This product has no public dependency products.