gspace

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Workspace (gspace) Skill

Google Workspace (gspace) 技能

You are a Google Workspace specialist with access to both the gspace CLI (a command-line tool you can invoke via Bash) and MCP (Model Context Protocol) tools. This skill provides comprehensive guidance for working with Google Drive, Gmail, Docs, Sheets, Calendar, and Tasks operations through both interfaces.
IMPORTANT: gspace is a CLI tool installed on the system. Use it via the Bash tool with commands like
gspace drive files ls
or
gspace gmail search --query "subject:urgent"
. It is NOT only an MCP server.
你是一名Google Workspace专家,可访问gspace CLI(可通过Bash调用的命令行工具)和MCP(模型上下文协议)工具。本技能提供通过这两种接口操作Google Drive、Gmail、Docs、Sheets、Calendar和Tasks的全面指南。
重要提示: gspace是一款安装在系统上的CLI工具。通过Bash工具使用它,命令示例如
gspace drive files ls
gspace gmail search --query "subject:urgent"
。它并非仅作为MCP服务器使用。

MCP vs CLI: When to Use Each

MCP与CLI:适用场景对比

Use MCP Tools When:

优先使用MCP工具的场景:

  • In conversation with user: MCP tools are available directly in Claude Code sessions
  • Reading metadata: Checking file properties, permissions, comments
  • Searching content: Finding files, emails, calendar events, tasks
  • Retrieving information: Getting email content, file metadata, calendar events
  • Quick lookups: Fast, single-operation queries
  • Parsing Excel files: Reading .xlsx file contents
  • Modifying content: Creating, updating, deleting files, emails, tasks, calendar events
  • 与用户交互时:MCP工具可直接在Claude Code会话中使用
  • 读取元数据:检查文件属性、权限、评论
  • 内容搜索:查找文件、邮件、日历事件、任务
  • 信息检索:获取邮件内容、文件元数据、日历事件
  • 快速查询:快速的单步操作查询
  • 解析Excel文件:读取.xlsx文件内容
  • 修改内容:创建、更新、删除文件、邮件、任务、日历事件

Use CLI When:

优先使用CLI的场景:

  • Complex workflows: Multi-step operations requiring scripting
  • Batch operations: Processing multiple items with shell scripts
  • File uploads/downloads: Transferring large files to/from local system
  • Interactive operations: Authentication flows, confirmations
  • Shell automation: Integration with other command-line tools
  • 复杂工作流:需要脚本实现的多步骤操作
  • 批量操作:通过Shell脚本处理多个项目
  • 文件上传/下载:在本地系统与云端之间传输大文件
  • 交互式操作:认证流程、确认步骤
  • Shell自动化:与其他命令行工具集成

Working with Google Docs/Sheets/Slides URLs

处理Google Docs/Sheets/Slides网址

IMPORTANT: When the user provides a Google Workspace URL, you can use it directly with CLI commands or extract the file ID for MCP tools.
重要提示: 当用户提供Google Workspace网址时,你可直接将其用于CLI命令,或提取文件ID用于MCP工具。

CLI Commands for Downloading

用于下载的CLI命令

For Google Docs (markdown output):
  • Recommended:
    gspace docs download FILE_ID /path/output.md
    - Cleaner markdown output, handles multi-tab docs automatically, no embedded images by default
  • Alternative:
    gspace files download FILE_ID /path/output.md --export markdown
    - Includes base64-encoded images inline, more verbose
For format conversion:
  • Use
    gspace files download FILE_ID /path/output.{pdf,docx,xlsx}
    with
    --export
    flag (supports pdf, docx, xlsx, html, text, etc.)
Important Notes:
  • gspace files download
    accepts file IDs (recommended) or full Google URLs (may fail with URL fragments)
  • gspace docs download
    only accepts file IDs
  • For cleaner, more readable markdown from Google Docs, prefer
    gspace docs download
Google Docs(输出为markdown):
  • 推荐:
    gspace docs download FILE_ID /path/output.md
    - 生成更简洁的markdown输出,自动处理多标签文档,默认不包含嵌入图片
  • 替代方案:
    gspace files download FILE_ID /path/output.md --export markdown
    - 包含base64编码的内嵌图片,内容更详细
格式转换:
  • 使用
    gspace files download FILE_ID /path/output.{pdf,docx,xlsx}
    并添加
    --export
    参数(支持pdf、docx、xlsx、html、text等格式)
重要说明:
  • gspace files download
    接受文件ID(推荐)或完整Google网址(带URL片段时可能失败)
  • gspace docs download
    仅接受文件ID
  • 若要从Google Docs获取更清晰易读的markdown,优先使用
    gspace docs download

URL Patterns and File ID Extraction

网址格式与文件ID提取

Google Docs:
https://docs.google.com/document/d/FILE_ID/edit...
Google Sheets:
https://docs.google.com/spreadsheets/d/FILE_ID/edit...
Google Slides:
https://docs.google.com/presentation/d/FILE_ID/edit...
Extraction: The file ID is the long alphanumeric string between
/d/
and
/edit
Google Docs:
https://docs.google.com/document/d/FILE_ID/edit...
Google Sheets:
https://docs.google.com/spreadsheets/d/FILE_ID/edit...
Google Slides:
https://docs.google.com/presentation/d/FILE_ID/edit...
提取方法: 文件ID是
/d/
/edit
之间的长字母数字字符串

Common URL Operations

常见网址操作

Example URL:
https://docs.google.com/document/d/1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc/edit?tab=t.nlbxgkk0bjwu
  • File ID:
    1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc
  • Tab ID:
    t.nlbxgkk0bjwu
    (optional, for multi-tab docs)
示例网址:
https://docs.google.com/document/d/1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc/edit?tab=t.nlbxgkk0bjwu
  • 文件ID:
    1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc
  • 标签ID:
    t.nlbxgkk0bjwu
    (可选,用于多标签文档)

Workflow: Fetch and Download from URL

工作流:从网址获取并下载文件

python
undefined
python
undefined

1. Extract file ID from URL

1. 从网址提取文件ID

file_id = "1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc"
file_id = "1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc"

2. Get metadata to understand the file

2. 获取元数据以了解文件信息

metadata = mcp__gdrive__drive_files_metadata(file_id=file_id)
metadata = mcp__gdrive__drive_files_metadata(file_id=file_id)

Returns: name, mimeType, created/modified times

返回:名称、mimeType、创建/修改时间

3. Download the file in desired format

3. 以所需格式下载文件

mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/document.md", export_format="markdown" )
mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/document.md", export_format="markdown" )

For multi-tab docs, specify tab_id

对于多标签文档,指定tab_id

mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/specific_tab.md", export_format="markdown", tab_id="t.nlbxgkk0bjwu" )
undefined
mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/specific_tab.md", export_format="markdown", tab_id="t.nlbxgkk0bjwu" )
undefined

Supported Export Formats

支持的导出格式

Google Docs:
  • markdown
    - Best for readable text (recommended)
  • pdf
    - Preserves formatting
  • docx
    - Microsoft Word format
  • text
    - Plain text only
Google Sheets:
  • xlsx
    - Excel format (preserves all sheets and formulas)
  • csv
    - Single sheet as CSV
  • pdf
    - Printable format
Google Slides:
  • pdf
    - Each slide as page
  • pptx
    - Microsoft PowerPoint format
Google Docs:
  • markdown
    - 最适合可读性文本(推荐)
  • pdf
    - 保留格式
  • docx
    - Microsoft Word格式
  • text
    - 纯文本格式
Google Sheets:
  • xlsx
    - Excel格式(保留所有工作表和公式)
  • csv
    - 单个工作表导出为CSV
  • pdf
    - 可打印格式
Google Slides:
  • pdf
    - 每张幻灯片对应一页
  • pptx
    - Microsoft PowerPoint格式

URL-Based Workflows

基于网址的工作流

Workflow 1: Read Doc from URL
python
undefined
工作流1:从网址读取文档
python
undefined
file_id = "ABC123"
file_id = "ABC123"

Download and read

下载并读取

mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/doc.md", export_format="markdown" )
mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/doc.md", export_format="markdown" )

Then read /tmp/doc.md using Read tool

然后使用Read工具读取/tmp/doc.md


**Workflow 2: Comment on Doc from URL**
```python

**工作流2:从网址给文档添加评论**
```python

Add comment to document

给文档添加评论

mcp__gdrive__docs_comments_create( file_id="ABC123", content="This section needs updating" )

**Workflow 3: Share Doc from URL**
```python
mcp__gdrive__docs_comments_create( file_id="ABC123", content="此部分需要更新" )

**工作流3:从网址分享文档**
```python

Grant access to document

授予文档访问权限

mcp__gdrive__permissions_grant( file_id="ABC123", role="reader", type="user", email="colleague@example.com" )

**Workflow 4: Parse Sheet from URL**
```python
mcp__gdrive__permissions_grant( file_id="ABC123", role="reader", type="user", email="colleague@example.com" )

**工作流4:从网址解析表格**
```python

For Google Sheets saved as .xlsx in Drive

针对Drive中保存为.xlsx的Google Sheets

file_id = "SHEET123"
file_id = "SHEET123"

If it's a Google Sheet, download as xlsx first

如果是Google Sheet,先下载为xlsx格式

mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/sheet.xlsx", export_format="xlsx" )
mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/sheet.xlsx", export_format="xlsx" )

Then parse the .xlsx file

然后解析.xlsx文件

(Note: For native Google Sheets, use sheets_* tools instead)

(注意:对于原生Google Sheets,使用sheets_*工具)

undefined
undefined

MCP Tools Complete Reference

MCP工具完整参考

Authentication Tools

认证工具

mcp__gdrive__drive_check_auth

mcp__gdrive__drive_check_auth

Verify Google Drive authentication status and OAuth scopes.
python
undefined
验证Google Drive认证状态和OAuth权限范围。
python
undefined

No parameters required

无需参数

mcp__gdrive__drive_check_auth()

**Returns:** Authentication status with account info and required scopes

**Use cases:**
- Verify authentication before file operations
- Diagnose access issues
- Confirm token validity
mcp__gdrive__drive_check_auth()

**返回:** 包含账户信息和所需权限范围的认证状态

**适用场景:**
- 文件操作前验证认证状态
- 诊断访问问题
- 确认令牌有效性

mcp__gdrive__gmail_check_auth

mcp__gdrive__gmail_check_auth

Verify Gmail API authentication and required scopes.
python
mcp__gdrive__gmail_check_auth()
验证Gmail API认证状态和所需权限范围。
python
mcp__gdrive__gmail_check_auth()

mcp__gdrive__calendar_check_auth

mcp__gdrive__calendar_check_auth

Verify Calendar API authentication and required scopes.
python
mcp__gdrive__calendar_check_auth()
验证Calendar API认证状态和所需权限范围。
python
mcp__gdrive__calendar_check_auth()

Google Drive File Operations

Google Drive文件操作

mcp__gdrive__drive_files_list

mcp__gdrive__drive_files_list

List files with advanced filtering (owner, dates, type, folder).
Parameters:
  • query
    (string, optional): Search query for file names
  • type
    (string, optional): MIME type filter
  • folder
    (string, optional): Search within specific folder ID
  • owner
    (string, optional): Filter by file owner email
  • created_after
    (string, optional): ISO date (YYYY-MM-DD)
  • created_before
    (string, optional): ISO date
  • modified_after
    (string, optional): ISO date
  • modified_before
    (string, optional): ISO date
  • order_by
    (string, optional): Sort order (e.g., "modifiedTime desc")
  • limit
    (number, optional): Max results (1-100, default: 10)
python
undefined
使用高级筛选(所有者、日期、类型、文件夹)列出文件。
参数:
  • query
    (字符串,可选):文件名搜索查询
  • type
    (字符串,可选):MIME类型筛选
  • folder
    (字符串,可选):在指定文件夹ID内搜索
  • owner
    (字符串,可选):按文件所有者邮箱筛选
  • created_after
    (字符串,可选):ISO日期(YYYY-MM-DD)
  • created_before
    (字符串,可选):ISO日期
  • modified_after
    (字符串,可选):ISO日期
  • modified_before
    (字符串,可选):ISO日期
  • order_by
    (字符串,可选):排序方式(例如"modifiedTime desc")
  • limit
    (数字,可选):最大结果数(1-100,默认:10)
python
undefined

Search by filename

按文件名搜索

mcp__gdrive__drive_files_list(query="report", limit=20)
mcp__gdrive__drive_files_list(query="report", limit=20)

Search by owner and date

按所有者和日期搜索

mcp__gdrive__drive_files_list( owner="user@example.com", modified_after="2025-01-01", order_by="modifiedTime desc" )
undefined
mcp__gdrive__drive_files_list( owner="user@example.com", modified_after="2025-01-01", order_by="modifiedTime desc" )
undefined

mcp__gdrive__drive_files_download

mcp__gdrive__drive_files_download

Download file with format conversion (PDF, DOCX, XLSX, markdown).
Parameters:
  • file_id
    (string, required): Google Drive file ID
  • local_path
    (string, required): Local file system path
  • export_format
    (string, optional): Export format (text, csv, xlsx, pdf, docx, markdown)
  • tab_id
    (string, optional): Specific tab ID for multi-tab Docs
  • max_size
    (number, optional): Max file size in bytes
  • timeout
    (number, optional): Download timeout in milliseconds
python
undefined
下载文件并支持格式转换(PDF、DOCX、XLSX、markdown)。
参数:
  • file_id
    (字符串,必填):Google Drive文件ID
  • local_path
    (字符串,必填):本地文件系统路径
  • export_format
    (字符串,可选):导出格式(text、csv、xlsx、pdf、docx、markdown)
  • tab_id
    (字符串,可选):多标签Docs的特定标签ID
  • max_size
    (数字,可选):最大文件大小(字节)
  • timeout
    (数字,可选):下载超时(毫秒)
python
undefined

Download Google Doc as markdown

将Google Doc下载为markdown

mcp__gdrive__drive_files_download( file_id="abc123", local_path="/tmp/document.md", export_format="markdown" )
mcp__gdrive__drive_files_download( file_id="abc123", local_path="/tmp/document.md", export_format="markdown" )

Download Google Sheet as Excel (preserves all sheets)

将Google Sheet下载为Excel(保留所有工作表)

mcp__gdrive__drive_files_download( file_id="sheet123", local_path="/tmp/data.xlsx", export_format="xlsx" )
undefined
mcp__gdrive__drive_files_download( file_id="sheet123", local_path="/tmp/data.xlsx", export_format="xlsx" )
undefined

mcp__gdrive__drive_files_upload

mcp__gdrive__drive_files_upload

Upload local files with automatic CSV→Sheets conversion.
Parameters:
  • local_path
    (string, required): Path to local file
  • name
    (string, optional): Name in Drive (defaults to filename)
  • parent_folder_id
    (string, optional): Parent folder ID
  • description
    (string, optional): File description
  • convert_to_google_format
    (boolean, optional): Convert CSV to Sheets
  • mime_type
    (string, optional): MIME type (auto-detected)
python
undefined
上传本地文件,支持自动将CSV转换为Sheets。
参数:
  • local_path
    (字符串,必填):本地文件路径
  • name
    (字符串,可选):在Drive中的名称(默认使用文件名)
  • parent_folder_id
    (字符串,可选):父文件夹ID
  • description
    (字符串,可选):文件描述
  • convert_to_google_format
    (布尔值,可选):将CSV转换为Sheets
  • mime_type
    (字符串,可选):MIME类型(自动检测)
python
undefined

Upload CSV and convert to Google Sheet

上传CSV并转换为Google Sheet

mcp__gdrive__drive_files_upload( local_path="/tmp/data.csv", name="Sales Data 2025", convert_to_google_format=True )
undefined
mcp__gdrive__drive_files_upload( local_path="/tmp/data.csv", name="Sales Data 2025", convert_to_google_format=True )
undefined

mcp__gdrive__drive_files_copy

mcp__gdrive__drive_files_copy

Create file/folder copies with optional renaming.
Parameters:
  • file_id
    (string, required): ID of file to copy
  • name
    (string, optional): Name for copy
  • parent_folder_id
    (string, optional): Destination folder
python
mcp__gdrive__drive_files_copy(
    file_id="abc123",
    name="Backup Copy",
    parent_folder_id="folder456"
)
创建文件/文件夹副本,支持可选重命名。
参数:
  • file_id
    (字符串,必填):要复制的文件ID
  • name
    (字符串,可选):副本名称
  • parent_folder_id
    (字符串,可选):目标文件夹
python
mcp__gdrive__drive_files_copy(
    file_id="abc123",
    name="Backup Copy",
    parent_folder_id="folder456"
)

mcp__gdrive__drive_files_rename

mcp__gdrive__drive_files_rename

Rename files and folders.
Parameters:
  • file_id
    (string, required): ID of file to rename
  • name
    (string, required): New name
python
mcp__gdrive__drive_files_rename(
    file_id="abc123",
    name="Updated Document Name"
)
重命名文件和文件夹。
参数:
  • file_id
    (字符串,必填):要重命名的文件ID
  • name
    (字符串,必填):新名称
python
mcp__gdrive__drive_files_rename(
    file_id="abc123",
    name="Updated Document Name"
)

mcp__gdrive__drive_files_delete

mcp__gdrive__drive_files_delete

Delete files/folders (trash or permanent).
Parameters:
  • file_id
    (string, required): ID of file to delete
  • permanently
    (boolean, optional): Permanent delete vs trash (default: false)
python
undefined
删除文件/文件夹(移入回收站或永久删除)。
参数:
  • file_id
    (字符串,必填):要删除的文件ID
  • permanently
    (布尔值,可选):永久删除还是移入回收站(默认:false)
python
undefined

Move to trash

移入回收站

mcp__gdrive__drive_files_delete(file_id="abc123")
mcp__gdrive__drive_files_delete(file_id="abc123")

Permanently delete

永久删除

mcp__gdrive__drive_files_delete(file_id="abc123", permanently=True)
undefined
mcp__gdrive__drive_files_delete(file_id="abc123", permanently=True)
undefined

mcp__gdrive__drive_files_metadata

mcp__gdrive__drive_files_metadata

Get comprehensive file metadata.
Parameters:
  • file_id
    (string, required): File ID
python
mcp__gdrive__drive_files_metadata(file_id="abc123")
Returns: Name, size, mimeType, created/modified times, owner, sharing settings
获取全面的文件元数据。
参数:
  • file_id
    (字符串,必填):文件ID
python
mcp__gdrive__drive_files_metadata(file_id="abc123")
返回: 名称、大小、mimeType、创建/修改时间、所有者、共享设置

mcp__gdrive__drive_files_validate_markdown

mcp__gdrive__drive_files_validate_markdown

Validate Google Docs export to markdown compatibility.
Parameters:
  • file_id
    (string, required): Google Doc file ID
python
mcp__gdrive__drive_files_validate_markdown(file_id="doc123")
Returns: Compatibility score and recommendations
验证Google Docs导出为markdown的兼容性。
参数:
  • file_id
    (字符串,必填):Google Doc文件ID
python
mcp__gdrive__drive_files_validate_markdown(file_id="doc123")
返回: 兼容性评分和建议

mcp__gdrive__drive_files_list_tabs

mcp__gdrive__drive_files_list_tabs

List all tabs in a Google Doc (experimental API).
Parameters:
  • file_id
    (string, required): Google Doc file ID
python
mcp__gdrive__drive_files_list_tabs(file_id="doc123")
列出Google Doc中的所有标签(实验性API)。
参数:
  • file_id
    (字符串,必填):Google Doc文件ID
python
mcp__gdrive__drive_files_list_tabs(file_id="doc123")

Google Drive Folder Operations

Google Drive文件夹操作

mcp__gdrive__drive_folders_create

mcp__gdrive__drive_folders_create

Create folders with optional descriptions.
Parameters:
  • name
    (string, required): Folder name
  • parent_folder_id
    (string, optional): Parent folder ID
  • description
    (string, optional): Folder description
python
mcp__gdrive__drive_folders_create(
    name="Project Documents",
    description="All project files"
)
创建文件夹,支持添加可选描述。
参数:
  • name
    (字符串,必填):文件夹名称
  • parent_folder_id
    (字符串,可选):父文件夹ID
  • description
    (字符串,可选):文件夹描述
python
mcp__gdrive__drive_folders_create(
    name="Project Documents",
    description="All project files"
)

mcp__gdrive__drive_folders_move

mcp__gdrive__drive_folders_move

Move files/folders between locations.
Parameters:
  • file_id
    (string, required): ID of file/folder to move
  • new_parent_folder_id
    (string, required): Destination folder ID
  • remove_from_current_parents
    (boolean, optional): Remove from current parents (default: true)
python
mcp__gdrive__drive_folders_move(
    file_id="abc123",
    new_parent_folder_id="folder456"
)
在不同位置之间移动文件/文件夹。
参数:
  • file_id
    (字符串,必填):要移动的文件/文件夹ID
  • new_parent_folder_id
    (字符串,必填):目标文件夹ID
  • remove_from_current_parents
    (布尔值,可选):从当前父文件夹移除(默认:true)
python
mcp__gdrive__drive_folders_move(
    file_id="abc123",
    new_parent_folder_id="folder456"
)

Permissions Management

权限管理

mcp__gdrive__permissions_grant

mcp__gdrive__permissions_grant

Grant user/group/domain access to files.
Parameters:
  • file_id
    (string, required): File ID
  • role
    (string, required): reader, writer, commenter, owner
  • type
    (string, required): user, group, domain, anyone
  • email
    (string, optional): Email address (for user/group)
  • domain
    (string, optional): Domain name or "current"
python
undefined
授予用户/群组/域对文件的访问权限。
参数:
  • file_id
    (字符串,必填):文件ID
  • role
    (字符串,必填):reader、writer、commenter、owner
  • type
    (字符串,必填):user、group、domain、anyone
  • email
    (字符串,可选):邮箱地址(针对user/group类型)
  • domain
    (字符串,可选):域名或"current"
python
undefined

Grant write access to user

授予用户写入权限

mcp__gdrive__permissions_grant( file_id="abc123", role="writer", type="user", email="user@example.com" )
mcp__gdrive__permissions_grant( file_id="abc123", role="writer", type="user", email="user@example.com" )

Share with entire domain

与整个域共享

mcp__gdrive__permissions_grant( file_id="abc123", role="reader", type="domain", domain="current" )
undefined
mcp__gdrive__permissions_grant( file_id="abc123", role="reader", type="domain", domain="current" )
undefined

mcp__gdrive__permissions_list

mcp__gdrive__permissions_list

List current file/folder permissions.
Parameters:
  • file_id
    (string, required): File ID
python
mcp__gdrive__permissions_list(file_id="abc123")
Returns: List of permissions with roles and email addresses
列出当前文件/文件夹的权限。
参数:
  • file_id
    (字符串,必填):文件ID
python
mcp__gdrive__permissions_list(file_id="abc123")
返回: 包含角色和邮箱地址的权限列表

mcp__gdrive__permissions_update

mcp__gdrive__permissions_update

Modify existing permission roles.
Parameters:
  • file_id
    (string, required): File ID
  • permission_id
    (string, required): Permission ID
  • role
    (string, required): New role (reader, writer, commenter)
python
mcp__gdrive__permissions_update(
    file_id="abc123",
    permission_id="perm456",
    role="commenter"
)
修改现有权限角色。
参数:
  • file_id
    (字符串,必填):文件ID
  • permission_id
    (字符串,必填):权限ID
  • role
    (字符串,必填):新角色(reader、writer、commenter)
python
mcp__gdrive__permissions_update(
    file_id="abc123",
    permission_id="perm456",
    role="commenter"
)

mcp__gdrive__permissions_revoke

mcp__gdrive__permissions_revoke

Remove user/group access.
Parameters:
  • file_id
    (string, required): File ID
  • permission_id
    (string, required): Permission ID to remove
python
mcp__gdrive__permissions_revoke(
    file_id="abc123",
    permission_id="perm456"
)
移除用户/群组的访问权限。
参数:
  • file_id
    (字符串,必填):文件ID
  • permission_id
    (字符串,必填):要移除的权限ID
python
mcp__gdrive__permissions_revoke(
    file_id="abc123",
    permission_id="perm456"
)

Google Docs Operations

Google Docs操作

mcp__gdrive__docs_create

mcp__gdrive__docs_create

Create Google Docs from markdown files.
Parameters:
  • local_path
    (string, required): Path to markdown file
  • name
    (string, required): Document name
  • parent_folder_id
    (string, optional): Parent folder ID
python
mcp__gdrive__docs_create(
    local_path="/tmp/notes.md",
    name="Meeting Notes",
    parent_folder_id="folder123"
)
从markdown文件创建Google Docs。
参数:
  • local_path
    (字符串,必填):markdown文件路径
  • name
    (字符串,必填):文档名称
  • parent_folder_id
    (字符串,可选):父文件夹ID
python
mcp__gdrive__docs_create(
    local_path="/tmp/notes.md",
    name="Meeting Notes",
    parent_folder_id="folder123"
)

mcp__gdrive__docs_download

mcp__gdrive__docs_download

Download Docs as markdown with footnote conversion.
Parameters:
  • file_id
    (string, required): Google Doc file ID
  • local_path
    (string, required): Output path
  • export_format
    (string, optional): Export format (markdown, pdf, docx)
python
mcp__gdrive__docs_download(
    file_id="doc123",
    local_path="/tmp/document.md",
    export_format="markdown"
)
将Docs下载为markdown,支持脚注转换。
参数:
  • file_id
    (字符串,必填):Google Doc文件ID
  • local_path
    (字符串,必填):输出路径
  • export_format
    (字符串,可选):导出格式(markdown、pdf、docx)
python
mcp__gdrive__docs_download(
    file_id="doc123",
    local_path="/tmp/document.md",
    export_format="markdown"
)

mcp__gdrive__docs_apply_text_diff

mcp__gdrive__docs_apply_text_diff

Update document content remotely without downloading.
Parameters:
  • file_id
    (string, required): Google Doc file ID
  • new_content
    (string, required): New text content
  • preserve_formatting
    (boolean, optional): Keep formatting (default: true)
python
mcp__gdrive__docs_apply_text_diff(
    file_id="doc123",
    new_content="Updated document text...",
    preserve_formatting=True
)
无需下载即可远程更新文档内容。
参数:
  • file_id
    (字符串,必填):Google Doc文件ID
  • new_content
    (字符串,必填):新文本内容
  • preserve_formatting
    (布尔值,可选):保留格式(默认:true)
python
mcp__gdrive__docs_apply_text_diff(
    file_id="doc123",
    new_content="Updated document text...",
    preserve_formatting=True
)

mcp__gdrive__docs_find_replace

mcp__gdrive__docs_find_replace

Find and replace text with case-sensitive/insensitive matching.
Parameters:
  • file_id
    (string, required): Google Doc file ID
  • find_text
    (string, required): Text to find
  • replace_text
    (string, required): Replacement text
  • match_case
    (boolean, optional): Case-sensitive (default: false)
  • tab_id
    (string, optional): Specific tab ID
python
undefined
查找并替换文本,支持区分大小写/不区分大小写匹配。
参数:
  • file_id
    (字符串,必填):Google Doc文件ID
  • find_text
    (字符串,必填):要查找的文本
  • replace_text
    (字符串,必填):替换文本
  • match_case
    (布尔值,可选):区分大小写(默认:false)
  • tab_id
    (字符串,可选):特定标签ID
python
undefined

Case-insensitive replacement

不区分大小写替换

mcp__gdrive__docs_find_replace( file_id="doc123", find_text="TODO", replace_text="DONE" )
mcp__gdrive__docs_find_replace( file_id="doc123", find_text="TODO", replace_text="DONE" )

Case-sensitive replacement

区分大小写替换

mcp__gdrive__docs_find_replace( file_id="doc123", find_text="Error", replace_text="Warning", match_case=True )
undefined
mcp__gdrive__docs_find_replace( file_id="doc123", find_text="Error", replace_text="Warning", match_case=True )
undefined

Google Docs Comments

Google Docs评论

mcp__gdrive__docs_comments_list

mcp__gdrive__docs_comments_list

List all comments on a document.
Parameters:
  • file_id
    (string, required): File ID
  • include_deleted
    (boolean, optional): Include deleted comments
  • page_size
    (number, optional): Results per page (1-100)
  • page_token
    (string, optional): Pagination token
python
mcp__gdrive__docs_comments_list(
    file_id="doc123",
    page_size=50
)
列出文档中的所有评论。
参数:
  • file_id
    (字符串,必填):文件ID
  • include_deleted
    (布尔值,可选):包含已删除的评论
  • page_size
    (数字,可选):每页结果数(1-100)
  • page_token
    (字符串,可选):分页令牌
python
mcp__gdrive__docs_comments_list(
    file_id="doc123",
    page_size=50
)

mcp__gdrive__docs_comments_get

mcp__gdrive__docs_comments_get

Get specific comment details.
Parameters:
  • file_id
    (string, required): File ID
  • comment_id
    (string, required): Comment ID
  • include_deleted
    (boolean, optional): Include deleted replies
python
mcp__gdrive__docs_comments_get(
    file_id="doc123",
    comment_id="comment456"
)
获取特定评论的详细信息。
参数:
  • file_id
    (字符串,必填):文件ID
  • comment_id
    (字符串,必填):评论ID
  • include_deleted
    (布尔值,可选):包含已删除的回复
python
mcp__gdrive__docs_comments_get(
    file_id="doc123",
    comment_id="comment456"
)

mcp__gdrive__docs_comments_create

mcp__gdrive__docs_comments_create

Add new comments to documents.
Parameters:
  • file_id
    (string, required): File ID
  • content
    (string, required): Comment text
  • anchor
    (string, optional): Anchor region for specific text
python
undefined
给文档添加新评论。
参数:
  • file_id
    (字符串,必填):文件ID
  • content
    (字符串,必填):评论文本
  • anchor
    (字符串,可选):特定文本的锚定区域
python
undefined

General comment

通用评论

mcp__gdrive__docs_comments_create( file_id="doc123", content="Please review this section" )
undefined
mcp__gdrive__docs_comments_create( file_id="doc123", content="Please review this section" )
undefined

mcp__gdrive__docs_comments_reply

mcp__gdrive__docs_comments_reply

Reply to existing comments.
Parameters:
  • file_id
    (string, required): File ID
  • comment_id
    (string, required): Comment ID
  • content
    (string, required): Reply text
  • action
    (string, optional): "resolve" or "reopen"
python
undefined
回复现有评论。
参数:
  • file_id
    (字符串,必填):文件ID
  • comment_id
    (字符串,必填):评论ID
  • content
    (字符串,必填):回复文本
  • action
    (字符串,可选):"resolve"或"reopen"
python
undefined

Reply and resolve

回复并标记为已解决

mcp__gdrive__docs_comments_reply( file_id="doc123", comment_id="comment456", content="Fixed, thanks!", action="resolve" )
undefined
mcp__gdrive__docs_comments_reply( file_id="doc123", comment_id="comment456", content="Fixed, thanks!", action="resolve" )
undefined

mcp__gdrive__docs_comments_resolve

mcp__gdrive__docs_comments_resolve

Mark comment as resolved.
Parameters:
  • file_id
    (string, required): File ID
  • comment_id
    (string, required): Comment ID
python
mcp__gdrive__docs_comments_resolve(
    file_id="doc123",
    comment_id="comment456"
)
将评论标记为已解决。
参数:
  • file_id
    (字符串,必填):文件ID
  • comment_id
    (字符串,必填):评论ID
python
mcp__gdrive__docs_comments_resolve(
    file_id="doc123",
    comment_id="comment456"
)

Google Sheets Operations

Google Sheets操作

mcp__gdrive__sheets_create

mcp__gdrive__sheets_create

Create sheets with initial headers and data.
Parameters:
  • name
    (string, required): Spreadsheet name
  • parent_folder_id
    (string, optional): Parent folder ID
  • headers
    (array, optional): Column headers
  • data
    (2D array, optional): Initial data rows
python
mcp__gdrive__sheets_create(
    name="Customer Database",
    headers=["Name", "Email", "Status"],
    data=[
        ["John Doe", "john@example.com", "Active"],
        ["Jane Smith", "jane@example.com", "Pending"]
    ]
)
创建包含初始表头和数据的表格。
参数:
  • name
    (字符串,必填):电子表格名称
  • parent_folder_id
    (字符串,可选):父文件夹ID
  • headers
    (数组,可选):列标题
  • data
    (二维数组,可选):初始数据行
python
mcp__gdrive__sheets_create(
    name="Customer Database",
    headers=["Name", "Email", "Status"],
    data=[
        ["John Doe", "john@example.com", "Active"],
        ["Jane Smith", "jane@example.com", "Pending"]
    ]
)

mcp__gdrive__sheets_update

mcp__gdrive__sheets_update

Modify specific cells using A1 notation with formula support.
Parameters:
  • file_id
    (string, required): Spreadsheet ID
  • range
    (string, required): A1 notation (e.g., "Sheet1!A1:C3")
  • values
    (2D array, required): Cell values
  • input_option
    (string, optional): "RAW" or "USER_ENTERED" (default)
python
undefined
使用A1表示法修改特定单元格,支持公式。
参数:
  • file_id
    (字符串,必填):电子表格ID
  • range
    (字符串,必填):A1表示法(例如"Sheet1!A1:C3")
  • values
    (二维数组,必填):单元格值
  • input_option
    (字符串,可选):"RAW"或"USER_ENTERED"(默认)
python
undefined

Update with formulas

使用公式更新

mcp__gdrive__sheets_update( file_id="sheet123", range="A1:B2", values=[ ["Product", "Price"], ["Widget", "=SUM(B3:B10)"] ], input_option="USER_ENTERED" )
undefined
mcp__gdrive__sheets_update( file_id="sheet123", range="A1:B2", values=[ ["Product", "Price"], ["Widget", "=SUM(B3:B10)"] ], input_option="USER_ENTERED" )
undefined

mcp__gdrive__sheets_append

mcp__gdrive__sheets_append

Append rows to end of data without range calculation.
Parameters:
  • file_id
    (string, required): Spreadsheet ID
  • values
    (2D array, required): Rows to append
  • range
    (string, optional): Starting range (default: "Sheet1!A1")
  • input_option
    (string, optional): "RAW" or "USER_ENTERED"
python
mcp__gdrive__sheets_append(
    file_id="sheet123",
    values=[
        ["New Customer", "new@example.com", "Active"],
        ["Another Customer", "another@example.com", "Pending"]
    ]
)
在数据末尾追加行,无需计算范围。
参数:
  • file_id
    (字符串,必填):电子表格ID
  • values
    (二维数组,必填):要追加的行
  • range
    (字符串,可选):起始范围(默认:"Sheet1!A1")
  • input_option
    (字符串,可选):"RAW"或"USER_ENTERED"
python
mcp__gdrive__sheets_append(
    file_id="sheet123",
    values=[
        ["New Customer", "new@example.com", "Active"],
        ["Another Customer", "another@example.com", "Pending"]
    ]
)

Google Calendar Operations

Google Calendar操作

mcp__gdrive__calendar_list

mcp__gdrive__calendar_list

List events with time range filtering and privacy controls.
Parameters:
  • calendar_id
    (string, optional): Calendar ID (default: "primary")
  • time_min
    (string, optional): Start time (RFC3339 format)
  • time_max
    (string, optional): End time (RFC3339 format)
  • max_results
    (number, optional): Max events (1-2500, default: 50)
  • page_token
    (string, optional): Pagination token
  • single_events
    (boolean, optional): Expand recurring events (default: true)
  • include_attendees
    (boolean, optional): Include attendees (default: false)
  • include_description
    (boolean, optional): Include description (default: false)
  • include_location
    (boolean, optional): Include location (default: false)
python
undefined
列出事件,支持时间范围筛选和隐私控制。
参数:
  • calendar_id
    (字符串,可选):日历ID(默认:"primary")
  • time_min
    (字符串,可选):开始时间(RFC3339格式)
  • time_max
    (字符串,可选):结束时间(RFC3339格式)
  • max_results
    (数字,可选):最大事件数(1-2500,默认:50)
  • page_token
    (字符串,可选):分页令牌
  • single_events
    (布尔值,可选):展开重复事件(默认:true)
  • include_attendees
    (布尔值,可选):包含参会者(默认:false)
  • include_description
    (布尔值,可选):包含描述(默认:false)
  • include_location
    (布尔值,可选):包含地点(默认:false)
python
undefined

List this month's events

列出本月的事件

mcp__gdrive__calendar_list( time_min="2025-01-01T00:00:00Z", time_max="2025-01-31T23:59:59Z", max_results=50 )
undefined
mcp__gdrive__calendar_list( time_min="2025-01-01T00:00:00Z", time_max="2025-01-31T23:59:59Z", max_results=50 )
undefined

mcp__gdrive__calendar_search

mcp__gdrive__calendar_search

Search events by text query with advanced filters.
Parameters:
  • q
    (string, optional): Free-text search query
  • calendar_id
    (string, optional): Calendar ID (default: "primary")
  • time_min
    (string, optional): Start time
  • time_max
    (string, optional): End time
  • max_results
    (number, optional): Max results (1-2500)
python
mcp__gdrive__calendar_search(
    q="team meeting",
    time_min="2025-01-01T00:00:00Z",
    max_results=10
)
通过文本查询搜索事件,支持高级筛选。
参数:
  • q
    (字符串,可选):自由文本搜索查询
  • calendar_id
    (字符串,可选):日历ID(默认:"primary")
  • time_min
    (字符串,可选):开始时间
  • time_max
    (字符串,可选):结束时间
  • max_results
    (数字,可选):最大结果数(1-2500)
python
mcp__gdrive__calendar_search(
    q="team meeting",
    time_min="2025-01-01T00:00:00Z",
    max_results=10
)

mcp__gdrive__calendar_create

mcp__gdrive__calendar_create

Create events with recurrence support.
Parameters:
  • summary
    (string, required): Event title
  • start
    (string, required): Start time (RFC3339)
  • end
    (string, required): End time (RFC3339)
  • calendar_id
    (string, optional): Calendar ID
  • description
    (string, optional): Event description
  • location
    (string, optional): Event location
  • recurrence
    (object, optional): Recurrence pattern
python
undefined
创建事件,支持重复规则。
参数:
  • summary
    (字符串,必填):事件标题
  • start
    (字符串,必填):开始时间(RFC3339)
  • end
    (字符串,必填):结束时间(RFC3339)
  • calendar_id
    (字符串,可选):日历ID
  • description
    (字符串,可选):事件描述
  • location
    (字符串,可选):事件地点
  • recurrence
    (对象,可选):重复模式
python
undefined

Create single event

创建单个事件

mcp__gdrive__calendar_create( summary="Sprint Planning", start="2025-11-10T14:00:00Z", end="2025-11-10T15:00:00Z" )
mcp__gdrive__calendar_create( summary="Sprint Planning", start="2025-11-10T14:00:00Z", end="2025-11-10T15:00:00Z" )

Create recurring event

创建重复事件

mcp__gdrive__calendar_create( summary="Daily Standup", start="2025-11-10T09:00:00Z", end="2025-11-10T09:15:00Z", recurrence={"frequency": "daily", "count": 30} )
undefined
mcp__gdrive__calendar_create( summary="Daily Standup", start="2025-11-10T09:00:00Z", end="2025-11-10T09:15:00Z", recurrence={"frequency": "daily", "count": 30} )
undefined

mcp__gdrive__calendar_update

mcp__gdrive__calendar_update

Modify existing calendar events.
Parameters:
  • event_id
    (string, required): Event ID
  • calendar_id
    (string, optional): Calendar ID
  • summary
    (string, optional): New title
  • start
    (string, optional): New start time
  • end
    (string, optional): New end time
  • description
    (string, optional): New description
python
mcp__gdrive__calendar_update(
    event_id="event123",
    summary="Updated Meeting Title",
    start="2025-11-10T15:00:00Z"
)
修改现有日历事件。
参数:
  • event_id
    (字符串,必填):事件ID
  • calendar_id
    (字符串,可选):日历ID
  • summary
    (字符串,可选):新标题
  • start
    (字符串,可选):新开始时间
  • end
    (字符串,可选):新结束时间
  • description
    (字符串,可选):新描述
python
mcp__gdrive__calendar_update(
    event_id="event123",
    summary="Updated Meeting Title",
    start="2025-11-10T15:00:00Z"
)

mcp__gdrive__calendar_delete

mcp__gdrive__calendar_delete

Remove events from calendar.
Parameters:
  • event_id
    (string, required): Event ID
  • calendar_id
    (string, optional): Calendar ID
python
mcp__gdrive__calendar_delete(event_id="event123")
从日历中移除事件。
参数:
  • event_id
    (字符串,必填):事件ID
  • calendar_id
    (字符串,可选):日历ID
python
mcp__gdrive__calendar_delete(event_id="event123")

mcp__gdrive__calendar_update_reminders

mcp__gdrive__calendar_update_reminders

Modify event reminder settings.
Parameters:
  • event_id
    (string, required): Event ID
  • calendar_id
    (string, optional): Calendar ID
  • use_default
    (boolean, required): Use calendar defaults
  • overrides
    (array, optional): Custom reminders (method, minutes)
  • send_updates
    (string, optional): "none", "all", "externalOnly"
python
undefined
修改事件提醒设置。
参数:
  • event_id
    (字符串,必填):事件ID
  • calendar_id
    (字符串,可选):日历ID
  • use_default
    (布尔值,必填):使用日历默认设置
  • overrides
    (数组,可选):自定义提醒(方式、分钟数)
  • send_updates
    (字符串,可选):"none"、"all"、"externalOnly"
python
undefined

Disable all reminders

禁用所有提醒

mcp__gdrive__calendar_update_reminders( event_id="event123", use_default=False, overrides=[] )
mcp__gdrive__calendar_update_reminders( event_id="event123", use_default=False, overrides=[] )

Set custom reminders

设置自定义提醒

mcp__gdrive__calendar_update_reminders( event_id="event123", use_default=False, overrides=[ {"method": "popup", "minutes": 10}, {"method": "email", "minutes": 60} ] )
undefined
mcp__gdrive__calendar_update_reminders( event_id="event123", use_default=False, overrides=[ {"method": "popup", "minutes": 10}, {"method": "email", "minutes": 60} ] )
undefined

Gmail Operations

Gmail操作

mcp__gdrive__gmail_search

mcp__gdrive__gmail_search

Search messages with advanced query syntax.
Parameters:
  • query
    (string, required): Gmail search query
  • max_results
    (number, optional): Max messages to return
python
undefined
使用高级查询语法搜索邮件。
参数:
  • query
    (字符串,必填):Gmail搜索查询
  • max_results
    (数字,可选):返回的最大邮件数
python
undefined

Search by sender and subject

按发件人和主题搜索

mcp__gdrive__gmail_search( query="from:boss@company.com subject:urgent", max_results=10 )
mcp__gdrive__gmail_search( query="from:boss@company.com subject:urgent", max_results=10 )

Search for attachments

搜索带附件的邮件

mcp__gdrive__gmail_search( query="has:attachment after:2025/01/01" )
undefined
mcp__gdrive__gmail_search( query="has:attachment after:2025/01/01" )
undefined

mcp__gdrive__gmail_get

mcp__gdrive__gmail_get

Get full message content with headers.
Parameters:
  • message_id
    (string, required): Gmail message ID
python
mcp__gdrive__gmail_get(message_id="msg123")
Returns: Complete message with headers, body, attachments metadata
获取包含邮件头的完整邮件内容。
参数:
  • message_id
    (字符串,必填):Gmail邮件ID
python
mcp__gdrive__gmail_get(message_id="msg123")
返回: 包含邮件头、正文、附件元数据的完整邮件

mcp__gdrive__gmail_thread

mcp__gdrive__gmail_thread

Get entire conversation thread.
Parameters:
  • thread_id
    (string, required): Gmail thread ID
python
mcp__gdrive__gmail_thread(thread_id="thread123")
获取整个对话线程。
参数:
  • thread_id
    (字符串,必填):Gmail线程ID
python
mcp__gdrive__gmail_thread(thread_id="thread123")

mcp__gdrive__gmail_send

mcp__gdrive__gmail_send

Send new messages with attachments.
Parameters:
  • to
    (string, required): Recipient email(s)
  • subject
    (string, required): Email subject
  • body
    (string, required): Message body
  • cc
    (string, optional): CC recipients
  • bcc
    (string, optional): BCC recipients
  • attachments
    (array, optional): File paths to attach
python
mcp__gdrive__gmail_send(
    to="user@example.com",
    subject="Project Update",
    body="Please find the attached report.",
    attachments=["/tmp/report.pdf"]
)
发送带附件的新邮件。
参数:
  • to
    (字符串,必填):收件人邮箱(多个用逗号分隔)
  • subject
    (字符串,必填):邮件主题
  • body
    (字符串,必填):邮件正文
  • cc
    (字符串,可选):抄送收件人
  • bcc
    (字符串,可选):密送收件人
  • attachments
    (数组,可选):要附加的文件路径
python
mcp__gdrive__gmail_send(
    to="user@example.com",
    subject="Project Update",
    body="Please find the attached report.",
    attachments=["/tmp/report.pdf"]
)

mcp__gdrive__gmail_draft

mcp__gdrive__gmail_draft

Create draft messages.
Parameters:
  • to
    (string, required): Recipient email
  • subject
    (string, required): Email subject
  • body
    (string, required): Message body
python
mcp__gdrive__gmail_draft(
    to="team@example.com",
    subject="Draft: Review Request",
    body="Please review this document..."
)
创建草稿邮件。
参数:
  • to
    (字符串,必填):收件人邮箱
  • subject
    (字符串,必填):邮件主题
  • body
    (字符串,必填):邮件正文
python
mcp__gdrive__gmail_draft(
    to="team@example.com",
    subject="Draft: Review Request",
    body="Please review this document..."
)

mcp__gdrive__gmail_send_draft

mcp__gdrive__gmail_send_draft

Send existing drafts.
Parameters:
  • draft_id
    (string, required): Draft ID
python
mcp__gdrive__gmail_send_draft(draft_id="draft123")
发送现有草稿。
参数:
  • draft_id
    (字符串,必填):草稿ID
python
mcp__gdrive__gmail_send_draft(draft_id="draft123")

mcp__gdrive__gmail_list_labels

mcp__gdrive__gmail_list_labels

List all Gmail labels.
python
undefined
列出所有Gmail标签。
python
undefined

No parameters required

无需参数

mcp__gdrive__gmail_list_labels()
undefined
mcp__gdrive__gmail_list_labels()
undefined

mcp__gdrive__gmail_label

mcp__gdrive__gmail_label

Add/remove labels on messages.
Parameters:
  • message_id
    (string, required): Message ID
  • add_labels
    (array, optional): Labels to add
  • remove_labels
    (array, optional): Labels to remove
python
mcp__gdrive__gmail_label(
    message_id="msg123",
    add_labels=["IMPORTANT"],
    remove_labels=["INBOX"]
)
给邮件添加/移除标签。
参数:
  • message_id
    (字符串,必填):邮件ID
  • add_labels
    (数组,可选):要添加的标签
  • remove_labels
    (数组,可选):要移除的标签
python
mcp__gdrive__gmail_label(
    message_id="msg123",
    add_labels=["IMPORTANT"],
    remove_labels=["INBOX"]
)

mcp__gdrive__gmail_archive

mcp__gdrive__gmail_archive

Archive messages (remove from inbox).
Parameters:
  • message_id
    (string, required): Message ID
python
mcp__gdrive__gmail_archive(message_id="msg123")
归档邮件(从收件箱移除)。
参数:
  • message_id
    (字符串,必填):邮件ID
python
mcp__gdrive__gmail_archive(message_id="msg123")

mcp__gdrive__gmail_star

mcp__gdrive__gmail_star

Star/unstar messages.
Parameters:
  • message_id
    (string, required): Message ID
  • unstar
    (boolean, optional): Unstar message (default: false)
python
undefined
给邮件添加/取消星标。
参数:
  • message_id
    (字符串,必填):邮件ID
  • unstar
    (布尔值,可选):取消星标(默认:false)
python
undefined

Star message

添加星标

mcp__gdrive__gmail_star(message_id="msg123")
mcp__gdrive__gmail_star(message_id="msg123")

Unstar message

取消星标

mcp__gdrive__gmail_star(message_id="msg123", unstar=True)
undefined
mcp__gdrive__gmail_star(message_id="msg123", unstar=True)
undefined

mcp__gdrive__gmail_trash

mcp__gdrive__gmail_trash

Move messages to trash.
Parameters:
  • message_id
    (string, required): Message ID
python
mcp__gdrive__gmail_trash(message_id="msg123")
将邮件移入回收站。
参数:
  • message_id
    (字符串,必填):邮件ID
python
mcp__gdrive__gmail_trash(message_id="msg123")

mcp__gdrive__gmail_delete

mcp__gdrive__gmail_delete

Permanently delete messages.
Parameters:
  • message_id
    (string, required): Message ID
python
mcp__gdrive__gmail_delete(message_id="msg123")
永久删除邮件。
参数:
  • message_id
    (字符串,必填):邮件ID
python
mcp__gdrive__gmail_delete(message_id="msg123")

mcp__gdrive__gmail_download_attachment

mcp__gdrive__gmail_download_attachment

Download message attachments.
Parameters:
  • message_id
    (string, required): Message ID
  • attachment_id
    (string, required): Attachment ID
  • output_path
    (string, required): Local output path
python
mcp__gdrive__gmail_download_attachment(
    message_id="msg123",
    attachment_id="attach456",
    output_path="/tmp/document.pdf"
)
下载邮件附件。
参数:
  • message_id
    (字符串,必填):邮件ID
  • attachment_id
    (字符串,必填):附件ID
  • output_path
    (字符串,必填):本地输出路径
python
mcp__gdrive__gmail_download_attachment(
    message_id="msg123",
    attachment_id="attach456",
    output_path="/tmp/document.pdf"
)

Google Tasks Operations

Google Tasks操作

mcp__gdrive__tasks_list_lists

mcp__gdrive__tasks_list_lists

List all task lists.
python
undefined
列出所有任务列表。
python
undefined

No parameters required

无需参数

mcp__gdrive__tasks_list_lists()
undefined
mcp__gdrive__tasks_list_lists()
undefined

mcp__gdrive__tasks_get_list

mcp__gdrive__tasks_get_list

Get specific task list details.
Parameters:
  • task_list_id
    (string, required): Task list ID
python
mcp__gdrive__tasks_get_list(task_list_id="list123")
获取特定任务列表的详细信息。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
python
mcp__gdrive__tasks_get_list(task_list_id="list123")

mcp__gdrive__tasks_list

mcp__gdrive__tasks_list

List tasks in a task list.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • show_completed
    (boolean, optional): Include completed tasks
  • show_deleted
    (boolean, optional): Include deleted tasks
  • show_hidden
    (boolean, optional): Include hidden tasks
python
mcp__gdrive__tasks_list(
    task_list_id="list123",
    show_completed=True
)
列出任务列表中的任务。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • show_completed
    (布尔值,可选):包含已完成任务
  • show_deleted
    (布尔值,可选):包含已删除任务
  • show_hidden
    (布尔值,可选):包含隐藏任务
python
mcp__gdrive__tasks_list(
    task_list_id="list123",
    show_completed=True
)

mcp__gdrive__tasks_get

mcp__gdrive__tasks_get

Get specific task details.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • task_id
    (string, required): Task ID
python
mcp__gdrive__tasks_get(
    task_list_id="list123",
    task_id="task456"
)
获取特定任务的详细信息。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • task_id
    (字符串,必填):任务ID
python
mcp__gdrive__tasks_get(
    task_list_id="list123",
    task_id="task456"
)

mcp__gdrive__tasks_create_list

mcp__gdrive__tasks_create_list

Create new task lists.
Parameters:
  • title
    (string, required): Task list title
python
mcp__gdrive__tasks_create_list(title="Q1 Goals")
创建新的任务列表。
参数:
  • title
    (字符串,必填):任务列表标题
python
mcp__gdrive__tasks_create_list(title="Q1 Goals")

mcp__gdrive__tasks_create

mcp__gdrive__tasks_create

Create new tasks with due dates.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • title
    (string, required): Task title
  • notes
    (string, optional): Task notes
  • due
    (string, optional): Due date (RFC3339)
  • parent
    (string, optional): Parent task ID
python
mcp__gdrive__tasks_create(
    task_list_id="list123",
    title="Review PR #42",
    due="2025-11-10T17:00:00Z",
    notes="High priority"
)
创建带截止日期的新任务。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • title
    (字符串,必填):任务标题
  • notes
    (字符串,可选):任务备注
  • due
    (字符串,可选):截止日期(RFC3339)
  • parent
    (字符串,可选):父任务ID
python
mcp__gdrive__tasks_create(
    task_list_id="list123",
    title="Review PR #42",
    due="2025-11-10T17:00:00Z",
    notes="High priority"
)

mcp__gdrive__tasks_update

mcp__gdrive__tasks_update

Modify existing tasks.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • task_id
    (string, required): Task ID
  • title
    (string, optional): New title
  • notes
    (string, optional): New notes
  • due
    (string, optional): New due date
  • status
    (string, optional): "needsAction" or "completed"
python
mcp__gdrive__tasks_update(
    task_list_id="list123",
    task_id="task456",
    title="Updated Task Title",
    status="completed"
)
修改现有任务。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • task_id
    (字符串,必填):任务ID
  • title
    (字符串,可选):新标题
  • notes
    (字符串,可选):新备注
  • due
    (字符串,可选):新截止日期
  • status
    (字符串,可选):"needsAction"或"completed"
python
mcp__gdrive__tasks_update(
    task_list_id="list123",
    task_id="task456",
    title="Updated Task Title",
    status="completed"
)

mcp__gdrive__tasks_complete

mcp__gdrive__tasks_complete

Mark tasks as completed.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • task_id
    (string, required): Task ID
python
mcp__gdrive__tasks_complete(
    task_list_id="list123",
    task_id="task456"
)
将任务标记为已完成。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • task_id
    (字符串,必填):任务ID
python
mcp__gdrive__tasks_complete(
    task_list_id="list123",
    task_id="task456"
)

mcp__gdrive__tasks_delete

mcp__gdrive__tasks_delete

Delete tasks.
Parameters:
  • task_list_id
    (string, required): Task list ID
  • task_id
    (string, required): Task ID
python
mcp__gdrive__tasks_delete(
    task_list_id="list123",
    task_id="task456"
)
删除任务。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
  • task_id
    (字符串,必填):任务ID
python
mcp__gdrive__tasks_delete(
    task_list_id="list123",
    task_id="task456"
)

mcp__gdrive__tasks_clear_completed

mcp__gdrive__tasks_clear_completed

Clear all completed tasks from a list.
Parameters:
  • task_list_id
    (string, required): Task list ID
python
mcp__gdrive__tasks_clear_completed(task_list_id="list123")
清除列表中所有已完成的任务。
参数:
  • task_list_id
    (字符串,必填):任务列表ID
python
mcp__gdrive__tasks_clear_completed(task_list_id="list123")

XLSX File Operations

XLSX文件操作

mcp__gdrive__parse_xlsx

mcp__gdrive__parse_xlsx

Parse Excel (.xlsx) file contents.
Parameters:
  • file_id
    (string, required): Google Drive file ID of .xlsx file
python
mcp__gdrive__parse_xlsx(file_id="spreadsheet123")
Returns: Structured data from Excel file (sheets, rows, columns)
解析Excel(.xlsx)文件内容。
参数:
  • file_id
    (字符串,必填):Google Drive中.xlsx文件的ID
python
mcp__gdrive__parse_xlsx(file_id="spreadsheet123")
返回: Excel文件的结构化数据(工作表、行、列)

mcp__gdrive__write_xlsx

mcp__gdrive__write_xlsx

Create XLSX file from JSON workbook structure.
Parameters:
  • workbook
    (object, required): Workbook structure with sheets array
  • file_path
    (string, required): Absolute path where XLSX should be created
python
mcp__gdrive__write_xlsx(
    workbook={
        "sheets": [
            {
                "name": "Q1 Budget",
                "data": [
                    ["Category", "Amount"],
                    ["Salaries", 150000],
                    ["Marketing", 75000]
                ],
                "formulas": {
                    "B4": "=SUM(B2:B3)"
                }
            }
        ]
    },
    file_path="/tmp/output.xlsx"
)
从JSON工作簿结构创建XLSX文件。
参数:
  • workbook
    (对象,必填):包含sheets数组的工作簿结构
  • file_path
    (字符串,必填):要创建XLSX文件的绝对路径
python
mcp__gdrive__write_xlsx(
    workbook={
        "sheets": [
            {
                "name": "Q1 Budget",
                "data": [
                    ["Category", "Amount"],
                    ["Salaries", 150000],
                    ["Marketing", 75000]
                ],
                "formulas": {
                    "B4": "=SUM(B2:B3)"
                }
            }
        ]
    },
    file_path="/tmp/output.xlsx"
)

CLI Operations Reference

CLI操作参考

Authentication

认证

bash
undefined
bash
undefined

Check authentication status

检查认证状态

gspace auth check
gspace auth check

Login (interactive)

登录(交互式)

gspace auth login
undefined
gspace auth login
undefined

Drive File Operations

Drive文件操作

bash
undefined
bash
undefined

List files

列出文件

gspace drive files ls gspace drive files ls --owner user@example.com --limit 20
gspace drive files ls gspace drive files ls --owner user@example.com --limit 20

Download files (accepts file IDs or full Google URLs)

下载文件(接受文件ID或完整Google网址)

gspace files download FILE_ID /tmp/document.pdf gspace files download FILE_ID_OR_URL /tmp/doc.md --export markdown gspace files download "https://docs.google.com/document/d/FILE_ID/edit" /tmp/doc.md --export markdown gspace files download FILE_ID /tmp/sheet.xlsx --export xlsx
gspace files download FILE_ID /tmp/document.pdf gspace files download FILE_ID_OR_URL /tmp/doc.md --export markdown gspace files download "https://docs.google.com/document/d/FILE_ID/edit" /tmp/doc.md --export markdown gspace files download FILE_ID /tmp/sheet.xlsx --export xlsx

Upload files

上传文件

gspace drive files upload /path/to/file "File Name" gspace drive files upload data.csv "Spreadsheet" --convert
gspace drive files upload /path/to/file "File Name" gspace drive files upload data.csv "Spreadsheet" --convert

Copy, rename, delete

复制、重命名、删除

gspace drive files copy FILE_ID --name "Copy of Document" gspace drive files rename FILE_ID "New Name" gspace drive files delete FILE_ID
gspace drive files copy FILE_ID --name "Copy of Document" gspace drive files rename FILE_ID "New Name" gspace drive files delete FILE_ID

Get metadata

获取元数据

gspace drive files metadata FILE_ID
undefined
gspace drive files metadata FILE_ID
undefined

Drive Folders

Drive文件夹

bash
undefined
bash
undefined

Create folder

创建文件夹

gspace drive folders create "Project Documents"
gspace drive folders create "Project Documents"

Move file to folder

将文件移动到文件夹

gspace drive folders move FILE_ID FOLDER_ID
undefined
gspace drive folders move FILE_ID FOLDER_ID
undefined

Permissions

权限

bash
undefined
bash
undefined

Grant permission

授予权限

gspace permissions grant FILE_ID --type user --role writer --email user@example.com gspace permissions grant FILE_ID --type domain --role reader --domain current
gspace permissions grant FILE_ID --type user --role writer --email user@example.com gspace permissions grant FILE_ID --type domain --role reader --domain current

List permissions

列出权限

gspace permissions list FILE_ID
gspace permissions list FILE_ID

Update permission

更新权限

gspace permissions update FILE_ID PERMISSION_ID --role commenter
gspace permissions update FILE_ID PERMISSION_ID --role commenter

Revoke permission

撤销权限

gspace permissions revoke FILE_ID PERMISSION_ID
undefined
gspace permissions revoke FILE_ID PERMISSION_ID
undefined

Google Docs

Google Docs

bash
undefined
bash
undefined

Create doc from markdown

从markdown创建文档

gspace docs create /path/to/notes.md "Document Title"
gspace docs create /path/to/notes.md "Document Title"

Download doc as markdown (specialized command, auto-handles single/multi-tab docs)

将文档下载为markdown(专用命令,自动处理单/多标签文档)

gspace docs download DOC_ID /tmp/output.md gspace docs download DOC_ID /tmp/output.md --include-images
gspace docs download DOC_ID /tmp/output.md gspace docs download DOC_ID /tmp/output.md --include-images

Download doc with format conversion (use files download for format control)

带格式转换的文档下载(使用files download进行格式控制)

gspace files download DOC_ID /tmp/output.md --export markdown gspace files download DOC_ID /tmp/output.pdf --export pdf gspace files download DOC_ID /tmp/output.docx --export docx
gspace files download DOC_ID /tmp/output.md --export markdown gspace files download DOC_ID /tmp/output.pdf --export pdf gspace files download DOC_ID /tmp/output.docx --export docx

Find and replace

查找并替换

gspace docs find-replace DOC_ID "old text" "new text" gspace docs find-replace DOC_ID "Error" "Warning" --match-case
gspace docs find-replace DOC_ID "old text" "new text" gspace docs find-replace DOC_ID "Error" "Warning" --match-case

Comments

评论

gspace docs comments list DOC_ID gspace docs comments create DOC_ID "Great work!" gspace docs comments reply DOC_ID COMMENT_ID "Thanks!" gspace docs comments resolve DOC_ID COMMENT_ID
undefined
gspace docs comments list DOC_ID gspace docs comments create DOC_ID "Great work!" gspace docs comments reply DOC_ID COMMENT_ID "Thanks!" gspace docs comments resolve DOC_ID COMMENT_ID
undefined

Google Sheets

Google Sheets

bash
undefined
bash
undefined

Create sheet

创建表格

gspace sheets create "Sales Data" --headers "Product,Price,Quantity"
gspace sheets create "Sales Data" --headers "Product,Price,Quantity"

Update cells

更新单元格

gspace sheets update SHEET_ID --range "A1:B2" --values '[["Name","Value"],["Item",100]]'
gspace sheets update SHEET_ID --range "A1:B2" --values '[["Name","Value"],["Item",100]]'

Append rows

追加行

gspace sheets append SHEET_ID --values '[["New Row 1","Value 1"]]'
undefined
gspace sheets append SHEET_ID --values '[["New Row 1","Value 1"]]'
undefined

Google Calendar

Google Calendar

bash
undefined
bash
undefined

List events

列出事件

gspace calendar list --time-min 2025-01-01T00:00:00Z gspace calendar today gspace calendar tomorrow
gspace calendar list --time-min 2025-01-01T00:00:00Z gspace calendar today gspace calendar tomorrow

Search events

搜索事件

gspace calendar search --query "team meeting"
gspace calendar search --query "team meeting"

Create event

创建事件

gspace calendar create "Sprint Planning" --start "2025-11-10T14:00:00Z" --end "2025-11-10T15:00:00Z"
gspace calendar create "Sprint Planning" --start "2025-11-10T14:00:00Z" --end "2025-11-10T15:00:00Z"

Update/delete events

更新/删除事件

gspace calendar update EVENT_ID --summary "New Title" gspace calendar delete EVENT_ID
gspace calendar update EVENT_ID --summary "New Title" gspace calendar delete EVENT_ID

Update reminders

更新提醒设置

gspace calendar update-reminders EVENT_ID --disable
undefined
gspace calendar update-reminders EVENT_ID --disable
undefined

Gmail

Gmail

bash
undefined
bash
undefined

Search emails

搜索邮件

gspace gmail search --query "from:boss@company.com subject:urgent"
gspace gmail search --query "from:boss@company.com subject:urgent"

Get message/thread

获取邮件/线程

gspace gmail get MESSAGE_ID gspace gmail thread THREAD_ID
gspace gmail get MESSAGE_ID gspace gmail thread THREAD_ID

Send email

发送邮件

gspace gmail send --to user@example.com --subject "Hello" --body "Message" gspace gmail send --to user@example.com --subject "Report" --attach report.pdf
gspace gmail send --to user@example.com --subject "Hello" --body "Message" gspace gmail send --to user@example.com --subject "Report" --attach report.pdf

Draft management

草稿管理

gspace gmail draft --to team@example.com --subject "Review" gspace gmail send-draft DRAFT_ID
gspace gmail draft --to team@example.com --subject "Review" gspace gmail send-draft DRAFT_ID

Message management

邮件管理

gspace gmail archive MESSAGE_ID gspace gmail star MESSAGE_ID gspace gmail trash MESSAGE_ID gspace gmail delete MESSAGE_ID gspace gmail label MESSAGE_ID --add IMPORTANT --remove INBOX
gspace gmail archive MESSAGE_ID gspace gmail star MESSAGE_ID gspace gmail trash MESSAGE_ID gspace gmail delete MESSAGE_ID gspace gmail label MESSAGE_ID --add IMPORTANT --remove INBOX

Labels

标签

gspace gmail list-labels
gspace gmail list-labels

Download attachment

下载附件

gspace gmail download-attachment MESSAGE_ID ATTACHMENT_ID /tmp/file.pdf
undefined
gspace gmail download-attachment MESSAGE_ID ATTACHMENT_ID /tmp/file.pdf
undefined

Google Tasks

Google Tasks

bash
undefined
bash
undefined

List task lists

列出任务列表

gspace tasks list-lists
gspace tasks list-lists

List tasks

列出任务

gspace tasks list TASK_LIST_ID gspace tasks list TASK_LIST_ID --show-completed
gspace tasks list TASK_LIST_ID gspace tasks list TASK_LIST_ID --show-completed

Create task

创建任务

gspace tasks create TASK_LIST_ID "Review PR" --due "2025-11-10T17:00:00Z"
gspace tasks create TASK_LIST_ID "Review PR" --due "2025-11-10T17:00:00Z"

Update/complete/delete task

更新/完成/删除任务

gspace tasks update TASK_LIST_ID TASK_ID --title "Updated Title" gspace tasks complete TASK_LIST_ID TASK_ID gspace tasks delete TASK_LIST_ID TASK_ID
gspace tasks update TASK_LIST_ID TASK_ID --title "Updated Title" gspace tasks complete TASK_LIST_ID TASK_ID gspace tasks delete TASK_LIST_ID TASK_ID

Clear completed

清除已完成任务

gspace tasks clear-completed TASK_LIST_ID
undefined
gspace tasks clear-completed TASK_LIST_ID
undefined

Common Workflows

常见工作流

Workflow 1: Find and Download Documents (MCP)

工作流1:查找并下载文档(MCP)

python
undefined
python
undefined

1. Search for documents

1. 搜索文档

files = mcp__gdrive__drive_files_list( query="Q4 report", type="application/vnd.google-apps.document", limit=10 )
files = mcp__gdrive__drive_files_list( query="Q4 report", type="application/vnd.google-apps.document", limit=10 )

2. Download as markdown

2. 下载为markdown

mcp__gdrive__drive_files_download( file_id=files[0].id, local_path="/tmp/report.md", export_format="markdown" )
undefined
mcp__gdrive__drive_files_download( file_id=files[0].id, local_path="/tmp/report.md", export_format="markdown" )
undefined

Workflow 2: Email Task Management (MCP)

工作流2:邮件任务管理(MCP)

python
undefined
python
undefined

1. Search for emails with actionable items

1. 搜索带可操作项的邮件

messages = mcp__gdrive__gmail_search( query="subject:TODO is:unread", max_results=20 )
messages = mcp__gdrive__gmail_search( query="subject:TODO is:unread", max_results=20 )

2. Create tasks from emails

2. 从邮件创建任务

for message in messages: email = mcp__gdrive__gmail_get(message_id=message.id)
# Create task
mcp__gdrive__tasks_create(
    task_list_id="default",
    title=f"Follow up: {email.subject}",
    notes=email.snippet
)

# Archive email
mcp__gdrive__gmail_archive(message_id=message.id)
undefined
for message in messages: email = mcp__gdrive__gmail_get(message_id=message.id)
# 创建任务
mcp__gdrive__tasks_create(
    task_list_id="default",
    title=f"Follow up: {email.subject}",
    notes=email.snippet
)

# 归档邮件
mcp__gdrive__gmail_archive(message_id=message.id)
undefined

Workflow 3: Calendar Event Cleanup (MCP)

工作流3:日历事件清理(MCP)

python
undefined
python
undefined

1. Search for "do not block" events

1. 搜索“请勿阻止”事件

events = mcp__gdrive__calendar_search( q="do not block", time_min="2025-01-01T00:00:00Z" )
events = mcp__gdrive__calendar_search( q="do not block", time_min="2025-01-01T00:00:00Z" )

2. Disable reminders for each event

2. 为每个事件禁用提醒

for event in events: mcp__gdrive__calendar_update_reminders( event_id=event.id, use_default=False, overrides=[] )
undefined
for event in events: mcp__gdrive__calendar_update_reminders( event_id=event.id, use_default=False, overrides=[] )
undefined

Workflow 4: Bulk File Permissions (CLI)

工作流4:批量文件权限设置(CLI)

bash
undefined
bash
undefined

Share all PDFs in folder with team

与团队共享文件夹中的所有PDF文件

gspace drive files ls --folder-id FOLDER_ID --type application/pdf --json |
jq -r '.[].id' |
while read file_id; do gspace permissions grant "$file_id" --type domain --role reader --domain current done
undefined
gspace drive files ls --folder-id FOLDER_ID --type application/pdf --json |
jq -r '.[].id' |
while read file_id; do gspace permissions grant "$file_id" --type domain --role reader --domain current done
undefined

Workflow 5: Email Backup (CLI)

工作流5:邮件备份(CLI)

bash
undefined
bash
undefined

Download all attachments from specific sender

下载特定发件人的所有附件

gspace gmail search --query "from:vendor@example.com has:attachment" --json |
jq -r '.[].id' |
while read msg_id; do gspace gmail get "$msg_id" --json |
jq -r '.attachments[].id' |
while read attach_id; do gspace gmail download-attachment "$msg_id" "$attach_id" "/tmp/backup_${attach_id}.pdf" done done
undefined
gspace gmail search --query "from:vendor@example.com has:attachment" --json |
jq -r '.[].id' |
while read msg_id; do gspace gmail get "$msg_id" --json |
jq -r '.attachments[].id' |
while read attach_id; do gspace gmail download-attachment "$msg_id" "$attach_id" "/tmp/backup_${attach_id}.pdf" done done
undefined

Best Practices

最佳实践

General Principles

通用原则

  1. Prefer MCP for programmatic operations: MCP tools provide structured responses
  2. Use CLI for interactive workflows: Better for shell scripts and automation
  3. Batch operations carefully: Use pagination and limits to avoid overwhelming responses
  4. Check authentication first: Use
    *_check_auth
    tools before operations
  5. Handle errors gracefully: All MCP tools return error details in responses
  1. 优先使用MCP进行程序化操作:MCP工具提供结构化响应
  2. 使用CLI进行交互式工作流:更适合Shell脚本和自动化
  3. 谨慎处理批量操作:使用分页和限制避免响应过载
  4. 先检查认证状态:操作前使用
    *_check_auth
    工具
  5. 优雅处理错误:所有MCP工具在响应中返回错误详情

MCP-Specific Best Practices

MCP特定最佳实践

  1. Use appropriate limits: Set
    limit
    or
    max_results
    to avoid large responses
  2. Leverage filters: Use owner, date, type filters to narrow searches
  3. Parse responses: All MCP tools return structured JSON
  4. Privacy controls: Use calendar privacy flags to minimize PII exposure
  5. Pagination: Use
    page_token
    for large result sets
  1. 使用适当的限制:设置
    limit
    max_results
    避免大响应
  2. 利用筛选器:使用所有者、日期、类型筛选缩小搜索范围
  3. 解析响应:所有MCP工具返回结构化JSON
  4. 隐私控制:使用日历隐私标志减少PII暴露
  5. 分页处理:对大型结果集使用
    page_token

CLI-Specific Best Practices

CLI特定最佳实践

  1. JSON output for scripting: Use
    --json
    flag with
    jq
    for processing
  2. Confirm destructive operations: CLI prompts for confirmations by default
  3. Use environment variables: Set
    GOOGLE_CLOUD_PROJECT
    for quota management
  4. Batch with shell loops: Combine CLI with shell scripts for bulk operations
  1. 使用JSON输出进行脚本编写:结合
    --json
    标志和
    jq
    进行处理
  2. 确认破坏性操作:CLI默认会提示确认
  3. 使用环境变量:设置
    GOOGLE_CLOUD_PROJECT
    进行配额管理
  4. 使用Shell循环进行批量操作:将CLI与Shell脚本结合进行批量操作

Search Query Syntax

搜索查询语法

Drive Queries

Drive查询

  • name contains 'text'
    - Search by filename
  • fullText contains 'text'
    - Search file contents
  • mimeType = 'application/pdf'
    - Filter by file type
  • 'folder-id' in parents
    - Files in specific folder
  • trashed = false
    - Exclude trashed files
  • modifiedTime > '2025-01-01T00:00:00'
    - Modified after date
Common MIME types:
  • Google Docs:
    application/vnd.google-apps.document
  • Google Sheets:
    application/vnd.google-apps.spreadsheet
  • Google Slides:
    application/vnd.google-apps.presentation
  • PDF:
    application/pdf
  • name contains 'text'
    - 按文件名搜索
  • fullText contains 'text'
    - 搜索文件内容
  • mimeType = 'application/pdf'
    - 按文件类型筛选
  • 'folder-id' in parents
    - 特定文件夹中的文件
  • trashed = false
    - 排除已删除文件
  • modifiedTime > '2025-01-01T00:00:00'
    - 按修改日期筛选
常见MIME类型:
  • Google Docs:
    application/vnd.google-apps.document
  • Google Sheets:
    application/vnd.google-apps.spreadsheet
  • Google Slides:
    application/vnd.google-apps.presentation
  • PDF:
    application/pdf

Gmail Queries

Gmail查询

  • from:sender@example.com
    - From specific sender
  • to:recipient@example.com
    - To specific recipient
  • subject:keyword
    - Subject contains keyword
  • has:attachment
    - Has attachments
  • filename:pdf
    - Specific attachment type
  • after:2025/01/01
    - Date filters
  • before:2025/12/31
    - Date filters
  • is:unread
    - Unread messages
  • is:starred
    - Starred messages
  • label:IMPORTANT
    - Specific label
  • from:sender@example.com
    - 特定发件人
  • to:recipient@example.com
    - 特定收件人
  • subject:keyword
    - 主题包含关键词
  • has:attachment
    - 带附件
  • filename:pdf
    - 特定附件类型
  • after:2025/01/01
    - 日期筛选
  • before:2025/12/31
    - 日期筛选
  • is:unread
    - 未读邮件
  • is:starred
    - 已加星标邮件
  • label:IMPORTANT
    - 特定标签

Error Handling

错误处理

Common Errors

常见错误

Authentication Errors:
python
undefined
认证错误:
python
undefined

Check auth status

检查认证状态

mcp__gdrive__drive_check_auth()

**File Not Found:**
```python
mcp__gdrive__drive_check_auth()

**文件未找到:**
```python

Verify file exists

验证文件是否存在

try: metadata = mcp__gdrive__drive_files_metadata(file_id="abc123") except: # Handle missing file pass

**Permission Denied:**
```bash
try: metadata = mcp__gdrive__drive_files_metadata(file_id="abc123") except: # 处理文件不存在的情况 pass

**权限被拒绝:**
```bash

Re-authenticate with proper scopes

使用正确的权限范围重新认证

gcloud auth login --enable-gdrive-access
undefined
gcloud auth login --enable-gdrive-access
undefined

Quick Reference

快速参考

MCP Tools by Category

按类别划分的MCP工具

Authentication:
  • drive_check_auth
    ,
    gmail_check_auth
    ,
    calendar_check_auth
Drive Files:
  • drive_files_list
    ,
    drive_files_download
    ,
    drive_files_upload
  • drive_files_copy
    ,
    drive_files_rename
    ,
    drive_files_delete
  • drive_files_metadata
    ,
    drive_files_validate_markdown
    ,
    drive_files_list_tabs
Drive Folders:
  • drive_folders_create
    ,
    drive_folders_move
Permissions:
  • permissions_grant
    ,
    permissions_list
    ,
    permissions_update
    ,
    permissions_revoke
Docs:
  • docs_create
    ,
    docs_download
    ,
    docs_apply_text_diff
    ,
    docs_find_replace
Docs Comments:
  • docs_comments_list
    ,
    docs_comments_get
    ,
    docs_comments_create
  • docs_comments_reply
    ,
    docs_comments_resolve
Sheets:
  • sheets_create
    ,
    sheets_update
    ,
    sheets_append
Calendar:
  • calendar_list
    ,
    calendar_search
    ,
    calendar_create
  • calendar_update
    ,
    calendar_delete
    ,
    calendar_update_reminders
Gmail:
  • gmail_search
    ,
    gmail_get
    ,
    gmail_thread
  • gmail_send
    ,
    gmail_draft
    ,
    gmail_send_draft
  • gmail_list_labels
    ,
    gmail_label
    ,
    gmail_archive
    ,
    gmail_star
  • gmail_trash
    ,
    gmail_delete
    ,
    gmail_download_attachment
Tasks:
  • tasks_list_lists
    ,
    tasks_get_list
    ,
    tasks_list
    ,
    tasks_get
  • tasks_create_list
    ,
    tasks_create
    ,
    tasks_update
  • tasks_complete
    ,
    tasks_delete
    ,
    tasks_clear_completed
XLSX:
  • parse_xlsx
    ,
    write_xlsx
认证:
  • drive_check_auth
    ,
    gmail_check_auth
    ,
    calendar_check_auth
Drive文件:
  • drive_files_list
    ,
    drive_files_download
    ,
    drive_files_upload
  • drive_files_copy
    ,
    drive_files_rename
    ,
    drive_files_delete
  • drive_files_metadata
    ,
    drive_files_validate_markdown
    ,
    drive_files_list_tabs
Drive文件夹:
  • drive_folders_create
    ,
    drive_folders_move
权限:
  • permissions_grant
    ,
    permissions_list
    ,
    permissions_update
    ,
    permissions_revoke
Docs:
  • docs_create
    ,
    docs_download
    ,
    docs_apply_text_diff
    ,
    docs_find_replace
Docs评论:
  • docs_comments_list
    ,
    docs_comments_get
    ,
    docs_comments_create
  • docs_comments_reply
    ,
    docs_comments_resolve
Sheets:
  • sheets_create
    ,
    sheets_update
    ,
    sheets_append
Calendar:
  • calendar_list
    ,
    calendar_search
    ,
    calendar_create
  • calendar_update
    ,
    calendar_delete
    ,
    calendar_update_reminders
Gmail:
  • gmail_search
    ,
    gmail_get
    ,
    gmail_thread
  • gmail_send
    ,
    gmail_draft
    ,
    gmail_send_draft
  • gmail_list_labels
    ,
    gmail_label
    ,
    gmail_archive
    ,
    gmail_star
  • gmail_trash
    ,
    gmail_delete
    ,
    gmail_download_attachment
Tasks:
  • tasks_list_lists
    ,
    tasks_get_list
    ,
    tasks_list
    ,
    tasks_get
  • tasks_create_list
    ,
    tasks_create
    ,
    tasks_update
  • tasks_complete
    ,
    tasks_delete
    ,
    tasks_clear_completed
XLSX:
  • parse_xlsx
    ,
    write_xlsx

Summary

总结

Total MCP Tools: 40+ comprehensive Google Workspace operations
Use MCP tools for:
  • All CRUD operations (Create, Read, Update, Delete)
  • Searching and filtering content
  • Managing permissions and access control
  • Email, calendar, and task management
  • Document editing and collaboration
  • Spreadsheet data manipulation
Use CLI for:
  • Interactive authentication flows
  • Shell script automation
  • Batch operations with pipes
  • Human-readable output formatting
  • Quick shortcuts (calendar today/tomorrow)
Key advantages:
  • MCP: Structured responses, programmatic access, direct integration
  • CLI: Scriptable, interactive, human-friendly, shell integration
MCP工具总数: 40+种全面的Google Workspace操作工具
使用MCP工具进行:
  • 所有CRUD操作(创建、读取、更新、删除)
  • 内容搜索和筛选
  • 权限和访问控制管理
  • 邮件、日历和任务管理
  • 文档编辑和协作
  • 电子表格数据处理
使用CLI进行:
  • 交互式认证流程
  • Shell脚本自动化
  • 使用管道的批量操作
  • 人类可读的输出格式
  • 快捷操作(calendar today/tomorrow)
核心优势:
  • MCP:结构化响应、程序化访问、直接集成
  • CLI:可脚本化、交互式、人性化、Shell集成