gspace
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle 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 or . It is NOT only an MCP server.
gspace drive files lsgspace gmail search --query "subject:urgent"你是一名Google Workspace专家,可访问gspace CLI(可通过Bash调用的命令行工具)和MCP(模型上下文协议)工具。本技能提供通过这两种接口操作Google Drive、Gmail、Docs、Sheets、Calendar和Tasks的全面指南。
重要提示: gspace是一款安装在系统上的CLI工具。通过Bash工具使用它,命令示例如或。它并非仅作为MCP服务器使用。
gspace drive files lsgspace gmail search --query "subject:urgent"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: - Cleaner markdown output, handles multi-tab docs automatically, no embedded images by default
gspace docs download FILE_ID /path/output.md - Alternative: - Includes base64-encoded images inline, more verbose
gspace files download FILE_ID /path/output.md --export markdown
For format conversion:
- Use with
gspace files download FILE_ID /path/output.{pdf,docx,xlsx}flag (supports pdf, docx, xlsx, html, text, etc.)--export
Important Notes:
- accepts file IDs (recommended) or full Google URLs (may fail with URL fragments)
gspace files download - only accepts file IDs
gspace docs download - For cleaner, more readable markdown from Google Docs, prefer
gspace docs download
Google Docs(输出为markdown):
- 推荐: - 生成更简洁的markdown输出,自动处理多标签文档,默认不包含嵌入图片
gspace docs download FILE_ID /path/output.md - 替代方案: - 包含base64编码的内嵌图片,内容更详细
gspace files download FILE_ID /path/output.md --export markdown
格式转换:
- 使用并添加
gspace files download FILE_ID /path/output.{pdf,docx,xlsx}参数(支持pdf、docx、xlsx、html、text等格式)--export
重要说明:
- 接受文件ID(推荐)或完整Google网址(带URL片段时可能失败)
gspace files download - 仅接受文件ID
gspace docs download - 若要从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 and
/d//editGoogle 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//editCommon URL Operations
常见网址操作
Example URL:
https://docs.google.com/document/d/1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc/edit?tab=t.nlbxgkk0bjwu- File ID:
1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc - Tab ID: (optional, for multi-tab docs)
t.nlbxgkk0bjwu
示例网址:
https://docs.google.com/document/d/1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc/edit?tab=t.nlbxgkk0bjwu- 文件ID:
1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc - 标签ID: (可选,用于多标签文档)
t.nlbxgkk0bjwu
Workflow: Fetch and Download from URL
工作流:从网址获取并下载文件
python
undefinedpython
undefined1. 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"
)
undefinedmcp__gdrive__drive_files_download(
file_id=file_id,
local_path="/tmp/specific_tab.md",
export_format="markdown",
tab_id="t.nlbxgkk0bjwu"
)
undefinedSupported Export Formats
支持的导出格式
Google Docs:
- - Best for readable text (recommended)
markdown - - Preserves formatting
pdf - - Microsoft Word format
docx - - Plain text only
text
Google Sheets:
- - Excel format (preserves all sheets and formulas)
xlsx - - Single sheet as CSV
csv - - Printable format
pdf
Google Slides:
- - Each slide as page
pdf - - Microsoft PowerPoint format
pptx
Google Docs:
- - 最适合可读性文本(推荐)
markdown - - 保留格式
pdf - - Microsoft Word格式
docx - - 纯文本格式
text
Google Sheets:
- - Excel格式(保留所有工作表和公式)
xlsx - - 单个工作表导出为CSV
csv - - 可打印格式
pdf
Google Slides:
- - 每张幻灯片对应一页
pdf - - Microsoft PowerPoint格式
pptx
URL-Based Workflows
基于网址的工作流
Workflow 1: Read Doc from URL
python
undefined工作流1:从网址读取文档
python
undefinedUser provides: https://docs.google.com/document/d/ABC123/edit
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:从网址给文档添加评论**
```pythonAdd comment to document
给文档添加评论
mcp__gdrive__docs_comments_create(
file_id="ABC123",
content="This section needs updating"
)
**Workflow 3: Share Doc from URL**
```pythonmcp__gdrive__docs_comments_create(
file_id="ABC123",
content="此部分需要更新"
)
**工作流3:从网址分享文档**
```pythonGrant access to document
授予文档访问权限
mcp__gdrive__permissions_grant(
file_id="ABC123",
role="reader",
type="user",
email="colleague@example.com"
)
**Workflow 4: Parse Sheet from URL**
```pythonmcp__gdrive__permissions_grant(
file_id="ABC123",
role="reader",
type="user",
email="colleague@example.com"
)
**工作流4:从网址解析表格**
```pythonFor 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_*工具)
undefinedundefinedMCP Tools Complete Reference
MCP工具完整参考
Authentication Tools
认证工具
mcp__gdrive__drive_check_auth
mcp__gdrive__drive_check_authmcp__gdrive__drive_check_auth
mcp__gdrive__drive_check_authVerify Google Drive authentication status and OAuth scopes.
python
undefined验证Google Drive认证状态和OAuth权限范围。
python
undefinedNo 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 validitymcp__gdrive__drive_check_auth()
**返回:** 包含账户信息和所需权限范围的认证状态
**适用场景:**
- 文件操作前验证认证状态
- 诊断访问问题
- 确认令牌有效性mcp__gdrive__gmail_check_auth
mcp__gdrive__gmail_check_authmcp__gdrive__gmail_check_auth
mcp__gdrive__gmail_check_authVerify 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_authmcp__gdrive__calendar_check_auth
mcp__gdrive__calendar_check_authVerify 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_listmcp__gdrive__drive_files_list
mcp__gdrive__drive_files_listList files with advanced filtering (owner, dates, type, folder).
Parameters:
- (string, optional): Search query for file names
query - (string, optional): MIME type filter
type - (string, optional): Search within specific folder ID
folder - (string, optional): Filter by file owner email
owner - (string, optional): ISO date (YYYY-MM-DD)
created_after - (string, optional): ISO date
created_before - (string, optional): ISO date
modified_after - (string, optional): ISO date
modified_before - (string, optional): Sort order (e.g., "modifiedTime desc")
order_by - (number, optional): Max results (1-100, default: 10)
limit
python
undefined使用高级筛选(所有者、日期、类型、文件夹)列出文件。
参数:
- (字符串,可选):文件名搜索查询
query - (字符串,可选):MIME类型筛选
type - (字符串,可选):在指定文件夹ID内搜索
folder - (字符串,可选):按文件所有者邮箱筛选
owner - (字符串,可选):ISO日期(YYYY-MM-DD)
created_after - (字符串,可选):ISO日期
created_before - (字符串,可选):ISO日期
modified_after - (字符串,可选):ISO日期
modified_before - (字符串,可选):排序方式(例如"modifiedTime desc")
order_by - (数字,可选):最大结果数(1-100,默认:10)
limit
python
undefinedSearch 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"
)
undefinedmcp__gdrive__drive_files_list(
owner="user@example.com",
modified_after="2025-01-01",
order_by="modifiedTime desc"
)
undefinedmcp__gdrive__drive_files_download
mcp__gdrive__drive_files_downloadmcp__gdrive__drive_files_download
mcp__gdrive__drive_files_downloadDownload file with format conversion (PDF, DOCX, XLSX, markdown).
Parameters:
- (string, required): Google Drive file ID
file_id - (string, required): Local file system path
local_path - (string, optional): Export format (text, csv, xlsx, pdf, docx, markdown)
export_format - (string, optional): Specific tab ID for multi-tab Docs
tab_id - (number, optional): Max file size in bytes
max_size - (number, optional): Download timeout in milliseconds
timeout
python
undefined下载文件并支持格式转换(PDF、DOCX、XLSX、markdown)。
参数:
- (字符串,必填):Google Drive文件ID
file_id - (字符串,必填):本地文件系统路径
local_path - (字符串,可选):导出格式(text、csv、xlsx、pdf、docx、markdown)
export_format - (字符串,可选):多标签Docs的特定标签ID
tab_id - (数字,可选):最大文件大小(字节)
max_size - (数字,可选):下载超时(毫秒)
timeout
python
undefinedDownload 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"
)
undefinedmcp__gdrive__drive_files_download(
file_id="sheet123",
local_path="/tmp/data.xlsx",
export_format="xlsx"
)
undefinedmcp__gdrive__drive_files_upload
mcp__gdrive__drive_files_uploadmcp__gdrive__drive_files_upload
mcp__gdrive__drive_files_uploadUpload local files with automatic CSV→Sheets conversion.
Parameters:
- (string, required): Path to local file
local_path - (string, optional): Name in Drive (defaults to filename)
name - (string, optional): Parent folder ID
parent_folder_id - (string, optional): File description
description - (boolean, optional): Convert CSV to Sheets
convert_to_google_format - (string, optional): MIME type (auto-detected)
mime_type
python
undefined上传本地文件,支持自动将CSV转换为Sheets。
参数:
- (字符串,必填):本地文件路径
local_path - (字符串,可选):在Drive中的名称(默认使用文件名)
name - (字符串,可选):父文件夹ID
parent_folder_id - (字符串,可选):文件描述
description - (布尔值,可选):将CSV转换为Sheets
convert_to_google_format - (字符串,可选):MIME类型(自动检测)
mime_type
python
undefinedUpload 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
)
undefinedmcp__gdrive__drive_files_upload(
local_path="/tmp/data.csv",
name="Sales Data 2025",
convert_to_google_format=True
)
undefinedmcp__gdrive__drive_files_copy
mcp__gdrive__drive_files_copymcp__gdrive__drive_files_copy
mcp__gdrive__drive_files_copyCreate file/folder copies with optional renaming.
Parameters:
- (string, required): ID of file to copy
file_id - (string, optional): Name for copy
name - (string, optional): Destination folder
parent_folder_id
python
mcp__gdrive__drive_files_copy(
file_id="abc123",
name="Backup Copy",
parent_folder_id="folder456"
)创建文件/文件夹副本,支持可选重命名。
参数:
- (字符串,必填):要复制的文件ID
file_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_renamemcp__gdrive__drive_files_rename
mcp__gdrive__drive_files_renameRename files and folders.
Parameters:
- (string, required): ID of file to rename
file_id - (string, required): New name
name
python
mcp__gdrive__drive_files_rename(
file_id="abc123",
name="Updated Document Name"
)重命名文件和文件夹。
参数:
- (字符串,必填):要重命名的文件ID
file_id - (字符串,必填):新名称
name
python
mcp__gdrive__drive_files_rename(
file_id="abc123",
name="Updated Document Name"
)mcp__gdrive__drive_files_delete
mcp__gdrive__drive_files_deletemcp__gdrive__drive_files_delete
mcp__gdrive__drive_files_deleteDelete files/folders (trash or permanent).
Parameters:
- (string, required): ID of file to delete
file_id - (boolean, optional): Permanent delete vs trash (default: false)
permanently
python
undefined删除文件/文件夹(移入回收站或永久删除)。
参数:
- (字符串,必填):要删除的文件ID
file_id - (布尔值,可选):永久删除还是移入回收站(默认:false)
permanently
python
undefinedMove 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)
undefinedmcp__gdrive__drive_files_delete(file_id="abc123", permanently=True)
undefinedmcp__gdrive__drive_files_metadata
mcp__gdrive__drive_files_metadatamcp__gdrive__drive_files_metadata
mcp__gdrive__drive_files_metadataGet comprehensive file metadata.
Parameters:
- (string, required): File ID
file_id
python
mcp__gdrive__drive_files_metadata(file_id="abc123")Returns: Name, size, mimeType, created/modified times, owner, sharing settings
获取全面的文件元数据。
参数:
- (字符串,必填):文件ID
file_id
python
mcp__gdrive__drive_files_metadata(file_id="abc123")返回: 名称、大小、mimeType、创建/修改时间、所有者、共享设置
mcp__gdrive__drive_files_validate_markdown
mcp__gdrive__drive_files_validate_markdownmcp__gdrive__drive_files_validate_markdown
mcp__gdrive__drive_files_validate_markdownValidate Google Docs export to markdown compatibility.
Parameters:
- (string, required): Google Doc file ID
file_id
python
mcp__gdrive__drive_files_validate_markdown(file_id="doc123")Returns: Compatibility score and recommendations
验证Google Docs导出为markdown的兼容性。
参数:
- (字符串,必填):Google Doc文件ID
file_id
python
mcp__gdrive__drive_files_validate_markdown(file_id="doc123")返回: 兼容性评分和建议
mcp__gdrive__drive_files_list_tabs
mcp__gdrive__drive_files_list_tabsmcp__gdrive__drive_files_list_tabs
mcp__gdrive__drive_files_list_tabsList all tabs in a Google Doc (experimental API).
Parameters:
- (string, required): Google Doc file ID
file_id
python
mcp__gdrive__drive_files_list_tabs(file_id="doc123")列出Google Doc中的所有标签(实验性API)。
参数:
- (字符串,必填):Google Doc文件ID
file_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_createmcp__gdrive__drive_folders_create
mcp__gdrive__drive_folders_createCreate folders with optional descriptions.
Parameters:
- (string, required): Folder name
name - (string, optional): Parent folder ID
parent_folder_id - (string, optional): Folder description
description
python
mcp__gdrive__drive_folders_create(
name="Project Documents",
description="All project files"
)创建文件夹,支持添加可选描述。
参数:
- (字符串,必填):文件夹名称
name - (字符串,可选):父文件夹ID
parent_folder_id - (字符串,可选):文件夹描述
description
python
mcp__gdrive__drive_folders_create(
name="Project Documents",
description="All project files"
)mcp__gdrive__drive_folders_move
mcp__gdrive__drive_folders_movemcp__gdrive__drive_folders_move
mcp__gdrive__drive_folders_moveMove files/folders between locations.
Parameters:
- (string, required): ID of file/folder to move
file_id - (string, required): Destination folder ID
new_parent_folder_id - (boolean, optional): Remove from current parents (default: true)
remove_from_current_parents
python
mcp__gdrive__drive_folders_move(
file_id="abc123",
new_parent_folder_id="folder456"
)在不同位置之间移动文件/文件夹。
参数:
- (字符串,必填):要移动的文件/文件夹ID
file_id - (字符串,必填):目标文件夹ID
new_parent_folder_id - (布尔值,可选):从当前父文件夹移除(默认:true)
remove_from_current_parents
python
mcp__gdrive__drive_folders_move(
file_id="abc123",
new_parent_folder_id="folder456"
)Permissions Management
权限管理
mcp__gdrive__permissions_grant
mcp__gdrive__permissions_grantmcp__gdrive__permissions_grant
mcp__gdrive__permissions_grantGrant user/group/domain access to files.
Parameters:
- (string, required): File ID
file_id - (string, required): reader, writer, commenter, owner
role - (string, required): user, group, domain, anyone
type - (string, optional): Email address (for user/group)
email - (string, optional): Domain name or "current"
domain
python
undefined授予用户/群组/域对文件的访问权限。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):reader、writer、commenter、owner
role - (字符串,必填):user、group、domain、anyone
type - (字符串,可选):邮箱地址(针对user/group类型)
email - (字符串,可选):域名或"current"
domain
python
undefinedGrant 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"
)
undefinedmcp__gdrive__permissions_grant(
file_id="abc123",
role="reader",
type="domain",
domain="current"
)
undefinedmcp__gdrive__permissions_list
mcp__gdrive__permissions_listmcp__gdrive__permissions_list
mcp__gdrive__permissions_listList current file/folder permissions.
Parameters:
- (string, required): File ID
file_id
python
mcp__gdrive__permissions_list(file_id="abc123")Returns: List of permissions with roles and email addresses
列出当前文件/文件夹的权限。
参数:
- (字符串,必填):文件ID
file_id
python
mcp__gdrive__permissions_list(file_id="abc123")返回: 包含角色和邮箱地址的权限列表
mcp__gdrive__permissions_update
mcp__gdrive__permissions_updatemcp__gdrive__permissions_update
mcp__gdrive__permissions_updateModify existing permission roles.
Parameters:
- (string, required): File ID
file_id - (string, required): Permission ID
permission_id - (string, required): New role (reader, writer, commenter)
role
python
mcp__gdrive__permissions_update(
file_id="abc123",
permission_id="perm456",
role="commenter"
)修改现有权限角色。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):权限ID
permission_id - (字符串,必填):新角色(reader、writer、commenter)
role
python
mcp__gdrive__permissions_update(
file_id="abc123",
permission_id="perm456",
role="commenter"
)mcp__gdrive__permissions_revoke
mcp__gdrive__permissions_revokemcp__gdrive__permissions_revoke
mcp__gdrive__permissions_revokeRemove user/group access.
Parameters:
- (string, required): File ID
file_id - (string, required): Permission ID to remove
permission_id
python
mcp__gdrive__permissions_revoke(
file_id="abc123",
permission_id="perm456"
)移除用户/群组的访问权限。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):要移除的权限ID
permission_id
python
mcp__gdrive__permissions_revoke(
file_id="abc123",
permission_id="perm456"
)Google Docs Operations
Google Docs操作
mcp__gdrive__docs_create
mcp__gdrive__docs_createmcp__gdrive__docs_create
mcp__gdrive__docs_createCreate Google Docs from markdown files.
Parameters:
- (string, required): Path to markdown file
local_path - (string, required): Document name
name - (string, optional): Parent folder ID
parent_folder_id
python
mcp__gdrive__docs_create(
local_path="/tmp/notes.md",
name="Meeting Notes",
parent_folder_id="folder123"
)从markdown文件创建Google Docs。
参数:
- (字符串,必填):markdown文件路径
local_path - (字符串,必填):文档名称
name - (字符串,可选):父文件夹ID
parent_folder_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_downloadmcp__gdrive__docs_download
mcp__gdrive__docs_downloadDownload Docs as markdown with footnote conversion.
Parameters:
- (string, required): Google Doc file ID
file_id - (string, required): Output path
local_path - (string, optional): Export format (markdown, pdf, docx)
export_format
python
mcp__gdrive__docs_download(
file_id="doc123",
local_path="/tmp/document.md",
export_format="markdown"
)将Docs下载为markdown,支持脚注转换。
参数:
- (字符串,必填):Google Doc文件ID
file_id - (字符串,必填):输出路径
local_path - (字符串,可选):导出格式(markdown、pdf、docx)
export_format
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_diffmcp__gdrive__docs_apply_text_diff
mcp__gdrive__docs_apply_text_diffUpdate document content remotely without downloading.
Parameters:
- (string, required): Google Doc file ID
file_id - (string, required): New text content
new_content - (boolean, optional): Keep formatting (default: true)
preserve_formatting
python
mcp__gdrive__docs_apply_text_diff(
file_id="doc123",
new_content="Updated document text...",
preserve_formatting=True
)无需下载即可远程更新文档内容。
参数:
- (字符串,必填):Google Doc文件ID
file_id - (字符串,必填):新文本内容
new_content - (布尔值,可选):保留格式(默认:true)
preserve_formatting
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_replacemcp__gdrive__docs_find_replace
mcp__gdrive__docs_find_replaceFind and replace text with case-sensitive/insensitive matching.
Parameters:
- (string, required): Google Doc file ID
file_id - (string, required): Text to find
find_text - (string, required): Replacement text
replace_text - (boolean, optional): Case-sensitive (default: false)
match_case - (string, optional): Specific tab ID
tab_id
python
undefined查找并替换文本,支持区分大小写/不区分大小写匹配。
参数:
- (字符串,必填):Google Doc文件ID
file_id - (字符串,必填):要查找的文本
find_text - (字符串,必填):替换文本
replace_text - (布尔值,可选):区分大小写(默认:false)
match_case - (字符串,可选):特定标签ID
tab_id
python
undefinedCase-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
)
undefinedmcp__gdrive__docs_find_replace(
file_id="doc123",
find_text="Error",
replace_text="Warning",
match_case=True
)
undefinedGoogle Docs Comments
Google Docs评论
mcp__gdrive__docs_comments_list
mcp__gdrive__docs_comments_listmcp__gdrive__docs_comments_list
mcp__gdrive__docs_comments_listList all comments on a document.
Parameters:
- (string, required): File ID
file_id - (boolean, optional): Include deleted comments
include_deleted - (number, optional): Results per page (1-100)
page_size - (string, optional): Pagination token
page_token
python
mcp__gdrive__docs_comments_list(
file_id="doc123",
page_size=50
)列出文档中的所有评论。
参数:
- (字符串,必填):文件ID
file_id - (布尔值,可选):包含已删除的评论
include_deleted - (数字,可选):每页结果数(1-100)
page_size - (字符串,可选):分页令牌
page_token
python
mcp__gdrive__docs_comments_list(
file_id="doc123",
page_size=50
)mcp__gdrive__docs_comments_get
mcp__gdrive__docs_comments_getmcp__gdrive__docs_comments_get
mcp__gdrive__docs_comments_getGet specific comment details.
Parameters:
- (string, required): File ID
file_id - (string, required): Comment ID
comment_id - (boolean, optional): Include deleted replies
include_deleted
python
mcp__gdrive__docs_comments_get(
file_id="doc123",
comment_id="comment456"
)获取特定评论的详细信息。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):评论ID
comment_id - (布尔值,可选):包含已删除的回复
include_deleted
python
mcp__gdrive__docs_comments_get(
file_id="doc123",
comment_id="comment456"
)mcp__gdrive__docs_comments_create
mcp__gdrive__docs_comments_createmcp__gdrive__docs_comments_create
mcp__gdrive__docs_comments_createAdd new comments to documents.
Parameters:
- (string, required): File ID
file_id - (string, required): Comment text
content - (string, optional): Anchor region for specific text
anchor
python
undefined给文档添加新评论。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):评论文本
content - (字符串,可选):特定文本的锚定区域
anchor
python
undefinedGeneral comment
通用评论
mcp__gdrive__docs_comments_create(
file_id="doc123",
content="Please review this section"
)
undefinedmcp__gdrive__docs_comments_create(
file_id="doc123",
content="Please review this section"
)
undefinedmcp__gdrive__docs_comments_reply
mcp__gdrive__docs_comments_replymcp__gdrive__docs_comments_reply
mcp__gdrive__docs_comments_replyReply to existing comments.
Parameters:
- (string, required): File ID
file_id - (string, required): Comment ID
comment_id - (string, required): Reply text
content - (string, optional): "resolve" or "reopen"
action
python
undefined回复现有评论。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):评论ID
comment_id - (字符串,必填):回复文本
content - (字符串,可选):"resolve"或"reopen"
action
python
undefinedReply and resolve
回复并标记为已解决
mcp__gdrive__docs_comments_reply(
file_id="doc123",
comment_id="comment456",
content="Fixed, thanks!",
action="resolve"
)
undefinedmcp__gdrive__docs_comments_reply(
file_id="doc123",
comment_id="comment456",
content="Fixed, thanks!",
action="resolve"
)
undefinedmcp__gdrive__docs_comments_resolve
mcp__gdrive__docs_comments_resolvemcp__gdrive__docs_comments_resolve
mcp__gdrive__docs_comments_resolveMark comment as resolved.
Parameters:
- (string, required): File ID
file_id - (string, required): Comment ID
comment_id
python
mcp__gdrive__docs_comments_resolve(
file_id="doc123",
comment_id="comment456"
)将评论标记为已解决。
参数:
- (字符串,必填):文件ID
file_id - (字符串,必填):评论ID
comment_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_createmcp__gdrive__sheets_create
mcp__gdrive__sheets_createCreate sheets with initial headers and data.
Parameters:
- (string, required): Spreadsheet name
name - (string, optional): Parent folder ID
parent_folder_id - (array, optional): Column headers
headers - (2D array, optional): Initial data rows
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"]
]
)创建包含初始表头和数据的表格。
参数:
- (字符串,必填):电子表格名称
name - (字符串,可选):父文件夹ID
parent_folder_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_updatemcp__gdrive__sheets_update
mcp__gdrive__sheets_updateModify specific cells using A1 notation with formula support.
Parameters:
- (string, required): Spreadsheet ID
file_id - (string, required): A1 notation (e.g., "Sheet1!A1:C3")
range - (2D array, required): Cell values
values - (string, optional): "RAW" or "USER_ENTERED" (default)
input_option
python
undefined使用A1表示法修改特定单元格,支持公式。
参数:
- (字符串,必填):电子表格ID
file_id - (字符串,必填):A1表示法(例如"Sheet1!A1:C3")
range - (二维数组,必填):单元格值
values - (字符串,可选):"RAW"或"USER_ENTERED"(默认)
input_option
python
undefinedUpdate with formulas
使用公式更新
mcp__gdrive__sheets_update(
file_id="sheet123",
range="A1:B2",
values=[
["Product", "Price"],
["Widget", "=SUM(B3:B10)"]
],
input_option="USER_ENTERED"
)
undefinedmcp__gdrive__sheets_update(
file_id="sheet123",
range="A1:B2",
values=[
["Product", "Price"],
["Widget", "=SUM(B3:B10)"]
],
input_option="USER_ENTERED"
)
undefinedmcp__gdrive__sheets_append
mcp__gdrive__sheets_appendmcp__gdrive__sheets_append
mcp__gdrive__sheets_appendAppend rows to end of data without range calculation.
Parameters:
- (string, required): Spreadsheet ID
file_id - (2D array, required): Rows to append
values - (string, optional): Starting range (default: "Sheet1!A1")
range - (string, optional): "RAW" or "USER_ENTERED"
input_option
python
mcp__gdrive__sheets_append(
file_id="sheet123",
values=[
["New Customer", "new@example.com", "Active"],
["Another Customer", "another@example.com", "Pending"]
]
)在数据末尾追加行,无需计算范围。
参数:
- (字符串,必填):电子表格ID
file_id - (二维数组,必填):要追加的行
values - (字符串,可选):起始范围(默认:"Sheet1!A1")
range - (字符串,可选):"RAW"或"USER_ENTERED"
input_option
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_listmcp__gdrive__calendar_list
mcp__gdrive__calendar_listList events with time range filtering and privacy controls.
Parameters:
- (string, optional): Calendar ID (default: "primary")
calendar_id - (string, optional): Start time (RFC3339 format)
time_min - (string, optional): End time (RFC3339 format)
time_max - (number, optional): Max events (1-2500, default: 50)
max_results - (string, optional): Pagination token
page_token - (boolean, optional): Expand recurring events (default: true)
single_events - (boolean, optional): Include attendees (default: false)
include_attendees - (boolean, optional): Include description (default: false)
include_description - (boolean, optional): Include location (default: false)
include_location
python
undefined列出事件,支持时间范围筛选和隐私控制。
参数:
- (字符串,可选):日历ID(默认:"primary")
calendar_id - (字符串,可选):开始时间(RFC3339格式)
time_min - (字符串,可选):结束时间(RFC3339格式)
time_max - (数字,可选):最大事件数(1-2500,默认:50)
max_results - (字符串,可选):分页令牌
page_token - (布尔值,可选):展开重复事件(默认:true)
single_events - (布尔值,可选):包含参会者(默认:false)
include_attendees - (布尔值,可选):包含描述(默认:false)
include_description - (布尔值,可选):包含地点(默认:false)
include_location
python
undefinedList 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
)
undefinedmcp__gdrive__calendar_list(
time_min="2025-01-01T00:00:00Z",
time_max="2025-01-31T23:59:59Z",
max_results=50
)
undefinedmcp__gdrive__calendar_search
mcp__gdrive__calendar_searchmcp__gdrive__calendar_search
mcp__gdrive__calendar_searchSearch events by text query with advanced filters.
Parameters:
- (string, optional): Free-text search query
q - (string, optional): Calendar ID (default: "primary")
calendar_id - (string, optional): Start time
time_min - (string, optional): End time
time_max - (number, optional): Max results (1-2500)
max_results
python
mcp__gdrive__calendar_search(
q="team meeting",
time_min="2025-01-01T00:00:00Z",
max_results=10
)通过文本查询搜索事件,支持高级筛选。
参数:
- (字符串,可选):自由文本搜索查询
q - (字符串,可选):日历ID(默认:"primary")
calendar_id - (字符串,可选):开始时间
time_min - (字符串,可选):结束时间
time_max - (数字,可选):最大结果数(1-2500)
max_results
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_createmcp__gdrive__calendar_create
mcp__gdrive__calendar_createCreate events with recurrence support.
Parameters:
- (string, required): Event title
summary - (string, required): Start time (RFC3339)
start - (string, required): End time (RFC3339)
end - (string, optional): Calendar ID
calendar_id - (string, optional): Event description
description - (string, optional): Event location
location - (object, optional): Recurrence pattern
recurrence
python
undefined创建事件,支持重复规则。
参数:
- (字符串,必填):事件标题
summary - (字符串,必填):开始时间(RFC3339)
start - (字符串,必填):结束时间(RFC3339)
end - (字符串,可选):日历ID
calendar_id - (字符串,可选):事件描述
description - (字符串,可选):事件地点
location - (对象,可选):重复模式
recurrence
python
undefinedCreate 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}
)
undefinedmcp__gdrive__calendar_create(
summary="Daily Standup",
start="2025-11-10T09:00:00Z",
end="2025-11-10T09:15:00Z",
recurrence={"frequency": "daily", "count": 30}
)
undefinedmcp__gdrive__calendar_update
mcp__gdrive__calendar_updatemcp__gdrive__calendar_update
mcp__gdrive__calendar_updateModify existing calendar events.
Parameters:
- (string, required): Event ID
event_id - (string, optional): Calendar ID
calendar_id - (string, optional): New title
summary - (string, optional): New start time
start - (string, optional): New end time
end - (string, optional): New description
description
python
mcp__gdrive__calendar_update(
event_id="event123",
summary="Updated Meeting Title",
start="2025-11-10T15:00:00Z"
)修改现有日历事件。
参数:
- (字符串,必填):事件ID
event_id - (字符串,可选):日历ID
calendar_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_deletemcp__gdrive__calendar_delete
mcp__gdrive__calendar_deleteRemove events from calendar.
Parameters:
- (string, required): Event ID
event_id - (string, optional): Calendar ID
calendar_id
python
mcp__gdrive__calendar_delete(event_id="event123")从日历中移除事件。
参数:
- (字符串,必填):事件ID
event_id - (字符串,可选):日历ID
calendar_id
python
mcp__gdrive__calendar_delete(event_id="event123")mcp__gdrive__calendar_update_reminders
mcp__gdrive__calendar_update_remindersmcp__gdrive__calendar_update_reminders
mcp__gdrive__calendar_update_remindersModify event reminder settings.
Parameters:
- (string, required): Event ID
event_id - (string, optional): Calendar ID
calendar_id - (boolean, required): Use calendar defaults
use_default - (array, optional): Custom reminders (method, minutes)
overrides - (string, optional): "none", "all", "externalOnly"
send_updates
python
undefined修改事件提醒设置。
参数:
- (字符串,必填):事件ID
event_id - (字符串,可选):日历ID
calendar_id - (布尔值,必填):使用日历默认设置
use_default - (数组,可选):自定义提醒(方式、分钟数)
overrides - (字符串,可选):"none"、"all"、"externalOnly"
send_updates
python
undefinedDisable 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}
]
)
undefinedmcp__gdrive__calendar_update_reminders(
event_id="event123",
use_default=False,
overrides=[
{"method": "popup", "minutes": 10},
{"method": "email", "minutes": 60}
]
)
undefinedGmail Operations
Gmail操作
mcp__gdrive__gmail_search
mcp__gdrive__gmail_searchmcp__gdrive__gmail_search
mcp__gdrive__gmail_searchSearch messages with advanced query syntax.
Parameters:
- (string, required): Gmail search query
query - (number, optional): Max messages to return
max_results
python
undefined使用高级查询语法搜索邮件。
参数:
- (字符串,必填):Gmail搜索查询
query - (数字,可选):返回的最大邮件数
max_results
python
undefinedSearch 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"
)
undefinedmcp__gdrive__gmail_search(
query="has:attachment after:2025/01/01"
)
undefinedmcp__gdrive__gmail_get
mcp__gdrive__gmail_getmcp__gdrive__gmail_get
mcp__gdrive__gmail_getGet full message content with headers.
Parameters:
- (string, required): Gmail message ID
message_id
python
mcp__gdrive__gmail_get(message_id="msg123")Returns: Complete message with headers, body, attachments metadata
获取包含邮件头的完整邮件内容。
参数:
- (字符串,必填):Gmail邮件ID
message_id
python
mcp__gdrive__gmail_get(message_id="msg123")返回: 包含邮件头、正文、附件元数据的完整邮件
mcp__gdrive__gmail_thread
mcp__gdrive__gmail_threadmcp__gdrive__gmail_thread
mcp__gdrive__gmail_threadGet entire conversation thread.
Parameters:
- (string, required): Gmail thread ID
thread_id
python
mcp__gdrive__gmail_thread(thread_id="thread123")获取整个对话线程。
参数:
- (字符串,必填):Gmail线程ID
thread_id
python
mcp__gdrive__gmail_thread(thread_id="thread123")mcp__gdrive__gmail_send
mcp__gdrive__gmail_sendmcp__gdrive__gmail_send
mcp__gdrive__gmail_sendSend new messages with attachments.
Parameters:
- (string, required): Recipient email(s)
to - (string, required): Email subject
subject - (string, required): Message body
body - (string, optional): CC recipients
cc - (string, optional): BCC recipients
bcc - (array, optional): File paths to attach
attachments
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_draftmcp__gdrive__gmail_draft
mcp__gdrive__gmail_draftCreate draft messages.
Parameters:
- (string, required): Recipient email
to - (string, required): Email subject
subject - (string, required): Message body
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_draftmcp__gdrive__gmail_send_draft
mcp__gdrive__gmail_send_draftSend existing drafts.
Parameters:
- (string, required): Draft ID
draft_id
python
mcp__gdrive__gmail_send_draft(draft_id="draft123")发送现有草稿。
参数:
- (字符串,必填):草稿ID
draft_id
python
mcp__gdrive__gmail_send_draft(draft_id="draft123")mcp__gdrive__gmail_list_labels
mcp__gdrive__gmail_list_labelsmcp__gdrive__gmail_list_labels
mcp__gdrive__gmail_list_labelsList all Gmail labels.
python
undefined列出所有Gmail标签。
python
undefinedNo parameters required
无需参数
mcp__gdrive__gmail_list_labels()
undefinedmcp__gdrive__gmail_list_labels()
undefinedmcp__gdrive__gmail_label
mcp__gdrive__gmail_labelmcp__gdrive__gmail_label
mcp__gdrive__gmail_labelAdd/remove labels on messages.
Parameters:
- (string, required): Message ID
message_id - (array, optional): Labels to add
add_labels - (array, optional): Labels to remove
remove_labels
python
mcp__gdrive__gmail_label(
message_id="msg123",
add_labels=["IMPORTANT"],
remove_labels=["INBOX"]
)给邮件添加/移除标签。
参数:
- (字符串,必填):邮件ID
message_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_archivemcp__gdrive__gmail_archive
mcp__gdrive__gmail_archiveArchive messages (remove from inbox).
Parameters:
- (string, required): Message ID
message_id
python
mcp__gdrive__gmail_archive(message_id="msg123")归档邮件(从收件箱移除)。
参数:
- (字符串,必填):邮件ID
message_id
python
mcp__gdrive__gmail_archive(message_id="msg123")mcp__gdrive__gmail_star
mcp__gdrive__gmail_starmcp__gdrive__gmail_star
mcp__gdrive__gmail_starStar/unstar messages.
Parameters:
- (string, required): Message ID
message_id - (boolean, optional): Unstar message (default: false)
unstar
python
undefined给邮件添加/取消星标。
参数:
- (字符串,必填):邮件ID
message_id - (布尔值,可选):取消星标(默认:false)
unstar
python
undefinedStar 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)
undefinedmcp__gdrive__gmail_star(message_id="msg123", unstar=True)
undefinedmcp__gdrive__gmail_trash
mcp__gdrive__gmail_trashmcp__gdrive__gmail_trash
mcp__gdrive__gmail_trashMove messages to trash.
Parameters:
- (string, required): Message ID
message_id
python
mcp__gdrive__gmail_trash(message_id="msg123")将邮件移入回收站。
参数:
- (字符串,必填):邮件ID
message_id
python
mcp__gdrive__gmail_trash(message_id="msg123")mcp__gdrive__gmail_delete
mcp__gdrive__gmail_deletemcp__gdrive__gmail_delete
mcp__gdrive__gmail_deletePermanently delete messages.
Parameters:
- (string, required): Message ID
message_id
python
mcp__gdrive__gmail_delete(message_id="msg123")永久删除邮件。
参数:
- (字符串,必填):邮件ID
message_id
python
mcp__gdrive__gmail_delete(message_id="msg123")mcp__gdrive__gmail_download_attachment
mcp__gdrive__gmail_download_attachmentmcp__gdrive__gmail_download_attachment
mcp__gdrive__gmail_download_attachmentDownload message attachments.
Parameters:
- (string, required): Message ID
message_id - (string, required): Attachment ID
attachment_id - (string, required): Local output path
output_path
python
mcp__gdrive__gmail_download_attachment(
message_id="msg123",
attachment_id="attach456",
output_path="/tmp/document.pdf"
)下载邮件附件。
参数:
- (字符串,必填):邮件ID
message_id - (字符串,必填):附件ID
attachment_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_listsmcp__gdrive__tasks_list_lists
mcp__gdrive__tasks_list_listsList all task lists.
python
undefined列出所有任务列表。
python
undefinedNo parameters required
无需参数
mcp__gdrive__tasks_list_lists()
undefinedmcp__gdrive__tasks_list_lists()
undefinedmcp__gdrive__tasks_get_list
mcp__gdrive__tasks_get_listmcp__gdrive__tasks_get_list
mcp__gdrive__tasks_get_listGet specific task list details.
Parameters:
- (string, required): Task list ID
task_list_id
python
mcp__gdrive__tasks_get_list(task_list_id="list123")获取特定任务列表的详细信息。
参数:
- (字符串,必填):任务列表ID
task_list_id
python
mcp__gdrive__tasks_get_list(task_list_id="list123")mcp__gdrive__tasks_list
mcp__gdrive__tasks_listmcp__gdrive__tasks_list
mcp__gdrive__tasks_listList tasks in a task list.
Parameters:
- (string, required): Task list ID
task_list_id - (boolean, optional): Include completed tasks
show_completed - (boolean, optional): Include deleted tasks
show_deleted - (boolean, optional): Include hidden tasks
show_hidden
python
mcp__gdrive__tasks_list(
task_list_id="list123",
show_completed=True
)列出任务列表中的任务。
参数:
- (字符串,必填):任务列表ID
task_list_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_getmcp__gdrive__tasks_get
mcp__gdrive__tasks_getGet specific task details.
Parameters:
- (string, required): Task list ID
task_list_id - (string, required): Task ID
task_id
python
mcp__gdrive__tasks_get(
task_list_id="list123",
task_id="task456"
)获取特定任务的详细信息。
参数:
- (字符串,必填):任务列表ID
task_list_id - (字符串,必填):任务ID
task_id
python
mcp__gdrive__tasks_get(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_create_list
mcp__gdrive__tasks_create_listmcp__gdrive__tasks_create_list
mcp__gdrive__tasks_create_listCreate new task lists.
Parameters:
- (string, required): Task list title
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_createmcp__gdrive__tasks_create
mcp__gdrive__tasks_createCreate new tasks with due dates.
Parameters:
- (string, required): Task list ID
task_list_id - (string, required): Task title
title - (string, optional): Task notes
notes - (string, optional): Due date (RFC3339)
due - (string, optional): Parent task ID
parent
python
mcp__gdrive__tasks_create(
task_list_id="list123",
title="Review PR #42",
due="2025-11-10T17:00:00Z",
notes="High priority"
)创建带截止日期的新任务。
参数:
- (字符串,必填):任务列表ID
task_list_id - (字符串,必填):任务标题
title - (字符串,可选):任务备注
notes - (字符串,可选):截止日期(RFC3339)
due - (字符串,可选):父任务ID
parent
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_updatemcp__gdrive__tasks_update
mcp__gdrive__tasks_updateModify existing tasks.
Parameters:
- (string, required): Task list ID
task_list_id - (string, required): Task ID
task_id - (string, optional): New title
title - (string, optional): New notes
notes - (string, optional): New due date
due - (string, optional): "needsAction" or "completed"
status
python
mcp__gdrive__tasks_update(
task_list_id="list123",
task_id="task456",
title="Updated Task Title",
status="completed"
)修改现有任务。
参数:
- (字符串,必填):任务列表ID
task_list_id - (字符串,必填):任务ID
task_id - (字符串,可选):新标题
title - (字符串,可选):新备注
notes - (字符串,可选):新截止日期
due - (字符串,可选):"needsAction"或"completed"
status
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_completemcp__gdrive__tasks_complete
mcp__gdrive__tasks_completeMark tasks as completed.
Parameters:
- (string, required): Task list ID
task_list_id - (string, required): Task ID
task_id
python
mcp__gdrive__tasks_complete(
task_list_id="list123",
task_id="task456"
)将任务标记为已完成。
参数:
- (字符串,必填):任务列表ID
task_list_id - (字符串,必填):任务ID
task_id
python
mcp__gdrive__tasks_complete(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_delete
mcp__gdrive__tasks_deletemcp__gdrive__tasks_delete
mcp__gdrive__tasks_deleteDelete tasks.
Parameters:
- (string, required): Task list ID
task_list_id - (string, required): Task ID
task_id
python
mcp__gdrive__tasks_delete(
task_list_id="list123",
task_id="task456"
)删除任务。
参数:
- (字符串,必填):任务列表ID
task_list_id - (字符串,必填):任务ID
task_id
python
mcp__gdrive__tasks_delete(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_clear_completed
mcp__gdrive__tasks_clear_completedmcp__gdrive__tasks_clear_completed
mcp__gdrive__tasks_clear_completedClear all completed tasks from a list.
Parameters:
- (string, required): Task list ID
task_list_id
python
mcp__gdrive__tasks_clear_completed(task_list_id="list123")清除列表中所有已完成的任务。
参数:
- (字符串,必填):任务列表ID
task_list_id
python
mcp__gdrive__tasks_clear_completed(task_list_id="list123")XLSX File Operations
XLSX文件操作
mcp__gdrive__parse_xlsx
mcp__gdrive__parse_xlsxmcp__gdrive__parse_xlsx
mcp__gdrive__parse_xlsxParse Excel (.xlsx) file contents.
Parameters:
- (string, required): Google Drive file ID of .xlsx file
file_id
python
mcp__gdrive__parse_xlsx(file_id="spreadsheet123")Returns: Structured data from Excel file (sheets, rows, columns)
解析Excel(.xlsx)文件内容。
参数:
- (字符串,必填):Google Drive中.xlsx文件的ID
file_id
python
mcp__gdrive__parse_xlsx(file_id="spreadsheet123")返回: Excel文件的结构化数据(工作表、行、列)
mcp__gdrive__write_xlsx
mcp__gdrive__write_xlsxmcp__gdrive__write_xlsx
mcp__gdrive__write_xlsxCreate XLSX file from JSON workbook structure.
Parameters:
- (object, required): Workbook structure with sheets array
workbook - (string, required): Absolute path where XLSX should be created
file_path
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文件。
参数:
- (对象,必填):包含sheets数组的工作簿结构
workbook - (字符串,必填):要创建XLSX文件的绝对路径
file_path
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
undefinedbash
undefinedCheck authentication status
检查认证状态
gspace auth check
gspace auth check
Login (interactive)
登录(交互式)
gspace auth login
undefinedgspace auth login
undefinedDrive File Operations
Drive文件操作
bash
undefinedbash
undefinedList 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
undefinedgspace drive files metadata FILE_ID
undefinedDrive Folders
Drive文件夹
bash
undefinedbash
undefinedCreate 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
undefinedgspace drive folders move FILE_ID FOLDER_ID
undefinedPermissions
权限
bash
undefinedbash
undefinedGrant 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
undefinedgspace permissions revoke FILE_ID PERMISSION_ID
undefinedGoogle Docs
Google Docs
bash
undefinedbash
undefinedCreate 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
undefinedgspace 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
undefinedGoogle Sheets
Google Sheets
bash
undefinedbash
undefinedCreate 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"]]'
undefinedgspace sheets append SHEET_ID --values '[["New Row 1","Value 1"]]'
undefinedGoogle Calendar
Google Calendar
bash
undefinedbash
undefinedList 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
undefinedgspace calendar update-reminders EVENT_ID --disable
undefinedGmail
Gmail
bash
undefinedbash
undefinedSearch 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
undefinedgspace gmail download-attachment MESSAGE_ID ATTACHMENT_ID /tmp/file.pdf
undefinedGoogle Tasks
Google Tasks
bash
undefinedbash
undefinedList 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
undefinedgspace tasks clear-completed TASK_LIST_ID
undefinedCommon Workflows
常见工作流
Workflow 1: Find and Download Documents (MCP)
工作流1:查找并下载文档(MCP)
python
undefinedpython
undefined1. 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"
)
undefinedmcp__gdrive__drive_files_download(
file_id=files[0].id,
local_path="/tmp/report.md",
export_format="markdown"
)
undefinedWorkflow 2: Email Task Management (MCP)
工作流2:邮件任务管理(MCP)
python
undefinedpython
undefined1. 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)undefinedfor 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)undefinedWorkflow 3: Calendar Event Cleanup (MCP)
工作流3:日历事件清理(MCP)
python
undefinedpython
undefined1. 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=[]
)
undefinedfor event in events:
mcp__gdrive__calendar_update_reminders(
event_id=event.id,
use_default=False,
overrides=[]
)
undefinedWorkflow 4: Bulk File Permissions (CLI)
工作流4:批量文件权限设置(CLI)
bash
undefinedbash
undefinedShare 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
jq -r '.[].id' |
while read file_id; do gspace permissions grant "$file_id" --type domain --role reader --domain current done
undefinedgspace 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
jq -r '.[].id' |
while read file_id; do gspace permissions grant "$file_id" --type domain --role reader --domain current done
undefinedWorkflow 5: Email Backup (CLI)
工作流5:邮件备份(CLI)
bash
undefinedbash
undefinedDownload 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
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
undefinedgspace 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
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
undefinedBest Practices
最佳实践
General Principles
通用原则
- Prefer MCP for programmatic operations: MCP tools provide structured responses
- Use CLI for interactive workflows: Better for shell scripts and automation
- Batch operations carefully: Use pagination and limits to avoid overwhelming responses
- Check authentication first: Use tools before operations
*_check_auth - Handle errors gracefully: All MCP tools return error details in responses
- 优先使用MCP进行程序化操作:MCP工具提供结构化响应
- 使用CLI进行交互式工作流:更适合Shell脚本和自动化
- 谨慎处理批量操作:使用分页和限制避免响应过载
- 先检查认证状态:操作前使用工具
*_check_auth - 优雅处理错误:所有MCP工具在响应中返回错误详情
MCP-Specific Best Practices
MCP特定最佳实践
- Use appropriate limits: Set or
limitto avoid large responsesmax_results - Leverage filters: Use owner, date, type filters to narrow searches
- Parse responses: All MCP tools return structured JSON
- Privacy controls: Use calendar privacy flags to minimize PII exposure
- Pagination: Use for large result sets
page_token
- 使用适当的限制:设置或
limit避免大响应max_results - 利用筛选器:使用所有者、日期、类型筛选缩小搜索范围
- 解析响应:所有MCP工具返回结构化JSON
- 隐私控制:使用日历隐私标志减少PII暴露
- 分页处理:对大型结果集使用
page_token
CLI-Specific Best Practices
CLI特定最佳实践
- JSON output for scripting: Use flag with
--jsonfor processingjq - Confirm destructive operations: CLI prompts for confirmations by default
- Use environment variables: Set for quota management
GOOGLE_CLOUD_PROJECT - Batch with shell loops: Combine CLI with shell scripts for bulk operations
- 使用JSON输出进行脚本编写:结合标志和
--json进行处理jq - 确认破坏性操作:CLI默认会提示确认
- 使用环境变量:设置进行配额管理
GOOGLE_CLOUD_PROJECT - 使用Shell循环进行批量操作:将CLI与Shell脚本结合进行批量操作
Search Query Syntax
搜索查询语法
Drive Queries
Drive查询
- - Search by filename
name contains 'text' - - Search file contents
fullText contains 'text' - - Filter by file type
mimeType = 'application/pdf' - - Files in specific folder
'folder-id' in parents - - Exclude trashed files
trashed = false - - Modified after date
modifiedTime > '2025-01-01T00:00:00'
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 specific sender
from:sender@example.com - - To specific recipient
to:recipient@example.com - - Subject contains keyword
subject:keyword - - Has attachments
has:attachment - - Specific attachment type
filename:pdf - - Date filters
after:2025/01/01 - - Date filters
before:2025/12/31 - - Unread messages
is:unread - - Starred messages
is:starred - - Specific label
label:IMPORTANT
- - 特定发件人
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
undefinedCheck auth status
检查认证状态
mcp__gdrive__drive_check_auth()
**File Not Found:**
```pythonmcp__gdrive__drive_check_auth()
**文件未找到:**
```pythonVerify file exists
验证文件是否存在
try:
metadata = mcp__gdrive__drive_files_metadata(file_id="abc123")
except:
# Handle missing file
pass
**Permission Denied:**
```bashtry:
metadata = mcp__gdrive__drive_files_metadata(file_id="abc123")
except:
# 处理文件不存在的情况
pass
**权限被拒绝:**
```bashRe-authenticate with proper scopes
使用正确的权限范围重新认证
gcloud auth login --enable-gdrive-access
undefinedgcloud auth login --enable-gdrive-access
undefinedQuick Reference
快速参考
MCP Tools by Category
按类别划分的MCP工具
Authentication:
- ,
drive_check_auth,gmail_check_authcalendar_check_auth
Drive Files:
- ,
drive_files_list,drive_files_downloaddrive_files_upload - ,
drive_files_copy,drive_files_renamedrive_files_delete - ,
drive_files_metadata,drive_files_validate_markdowndrive_files_list_tabs
Drive Folders:
- ,
drive_folders_createdrive_folders_move
Permissions:
- ,
permissions_grant,permissions_list,permissions_updatepermissions_revoke
Docs:
- ,
docs_create,docs_download,docs_apply_text_diffdocs_find_replace
Docs Comments:
- ,
docs_comments_list,docs_comments_getdocs_comments_create - ,
docs_comments_replydocs_comments_resolve
Sheets:
- ,
sheets_create,sheets_updatesheets_append
Calendar:
- ,
calendar_list,calendar_searchcalendar_create - ,
calendar_update,calendar_deletecalendar_update_reminders
Gmail:
- ,
gmail_search,gmail_getgmail_thread - ,
gmail_send,gmail_draftgmail_send_draft - ,
gmail_list_labels,gmail_label,gmail_archivegmail_star - ,
gmail_trash,gmail_deletegmail_download_attachment
Tasks:
- ,
tasks_list_lists,tasks_get_list,tasks_listtasks_get - ,
tasks_create_list,tasks_createtasks_update - ,
tasks_complete,tasks_deletetasks_clear_completed
XLSX:
- ,
parse_xlsxwrite_xlsx
认证:
- ,
drive_check_auth,gmail_check_authcalendar_check_auth
Drive文件:
- ,
drive_files_list,drive_files_downloaddrive_files_upload - ,
drive_files_copy,drive_files_renamedrive_files_delete - ,
drive_files_metadata,drive_files_validate_markdowndrive_files_list_tabs
Drive文件夹:
- ,
drive_folders_createdrive_folders_move
权限:
- ,
permissions_grant,permissions_list,permissions_updatepermissions_revoke
Docs:
- ,
docs_create,docs_download,docs_apply_text_diffdocs_find_replace
Docs评论:
- ,
docs_comments_list,docs_comments_getdocs_comments_create - ,
docs_comments_replydocs_comments_resolve
Sheets:
- ,
sheets_create,sheets_updatesheets_append
Calendar:
- ,
calendar_list,calendar_searchcalendar_create - ,
calendar_update,calendar_deletecalendar_update_reminders
Gmail:
- ,
gmail_search,gmail_getgmail_thread - ,
gmail_send,gmail_draftgmail_send_draft - ,
gmail_list_labels,gmail_label,gmail_archivegmail_star - ,
gmail_trash,gmail_deletegmail_download_attachment
Tasks:
- ,
tasks_list_lists,tasks_get_list,tasks_listtasks_get - ,
tasks_create_list,tasks_createtasks_update - ,
tasks_complete,tasks_deletetasks_clear_completed
XLSX:
- ,
parse_xlsxwrite_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集成