Claude-skill-registry gspace
Use gspace CLI and MCP tools for Google Workspace operations (Drive, Gmail, Docs, Sheets, Calendar, Tasks). Use when working with Google Workspace URLs (docs.google.com, drive.google.com, sheets.google.com, slides.google.com, mail.google.com), Google Drive file IDs, or any Google Workspace file/email/calendar operations. Supports both CLI commands (via Bash) and 40+ MCP tools.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gspace" ~/.claude/skills/majiayu000-claude-skill-registry-gspace && rm -rf "$T"
skills/data/gspace/SKILL.mdGoogle Workspace (gspace) Skill
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.
MCP vs CLI: When to Use Each
Use MCP Tools When:
- 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
Use CLI When:
- 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
Working with Google Docs/Sheets/Slides URLs
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.
CLI Commands for Downloading
For Google Docs (markdown output):
- Recommended:
- Cleaner markdown output, handles multi-tab docs automatically, no embedded images by defaultgspace docs download FILE_ID /path/output.md - Alternative:
- Includes base64-encoded images inline, more verbosegspace files download FILE_ID /path/output.md --export markdown
For format conversion:
- Use
withgspace 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 IDsgspace docs download- For cleaner, more readable markdown from Google Docs, prefer
gspace docs download
URL Patterns and File ID Extraction
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
Common 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
Workflow: Fetch and Download from URL
# 1. Extract file ID from URL file_id = "1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc" # 2. Get metadata to understand the file metadata = mcp__gdrive__drive_files_metadata(file_id=file_id) # Returns: name, mimeType, created/modified times # 3. Download the file in desired format mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/document.md", export_format="markdown" ) # For multi-tab docs, specify tab_id mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/specific_tab.md", export_format="markdown", tab_id="t.nlbxgkk0bjwu" )
Supported Export Formats
Google Docs:
- Best for readable text (recommended)markdown
- Preserves formattingpdf
- Microsoft Word formatdocx
- Plain text onlytext
Google Sheets:
- Excel format (preserves all sheets and formulas)xlsx
- Single sheet as CSVcsv
- Printable formatpdf
Google Slides:
- Each slide as pagepdf
- Microsoft PowerPoint formatpptx
URL-Based Workflows
Workflow 1: Read Doc from URL
# User provides: https://docs.google.com/document/d/ABC123/edit file_id = "ABC123" # Download and read 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
Workflow 2: Comment on Doc from URL
# Add comment to document mcp__gdrive__docs_comments_create( file_id="ABC123", content="This section needs updating" )
Workflow 3: Share Doc from URL
# 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
# For Google Sheets saved as .xlsx in Drive file_id = "SHEET123" # If it's a Google Sheet, download as xlsx first mcp__gdrive__drive_files_download( file_id=file_id, local_path="/tmp/sheet.xlsx", export_format="xlsx" ) # Then parse the .xlsx file # (Note: For native Google Sheets, use sheets_* tools instead)
MCP Tools Complete Reference
Authentication Tools
mcp__gdrive__drive_check_auth
mcp__gdrive__drive_check_authVerify Google Drive authentication status and OAuth scopes.
# 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__gmail_check_auth
mcp__gdrive__gmail_check_authVerify Gmail API authentication and required scopes.
mcp__gdrive__gmail_check_auth()
mcp__gdrive__calendar_check_auth
mcp__gdrive__calendar_check_authVerify Calendar API authentication and required scopes.
mcp__gdrive__calendar_check_auth()
Google Drive File Operations
mcp__gdrive__drive_files_list
mcp__gdrive__drive_files_listList files with advanced filtering (owner, dates, type, folder).
Parameters:
(string, optional): Search query for file namesquery
(string, optional): MIME type filtertype
(string, optional): Search within specific folder IDfolder
(string, optional): Filter by file owner emailowner
(string, optional): ISO date (YYYY-MM-DD)created_after
(string, optional): ISO datecreated_before
(string, optional): ISO datemodified_after
(string, optional): ISO datemodified_before
(string, optional): Sort order (e.g., "modifiedTime desc")order_by
(number, optional): Max results (1-100, default: 10)limit
# Search by filename 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" )
mcp__gdrive__drive_files_download
mcp__gdrive__drive_files_downloadDownload file with format conversion (PDF, DOCX, XLSX, markdown).
Parameters:
(string, required): Google Drive file IDfile_id
(string, required): Local file system pathlocal_path
(string, optional): Export format (text, csv, xlsx, pdf, docx, markdown)export_format
(string, optional): Specific tab ID for multi-tab Docstab_id
(number, optional): Max file size in bytesmax_size
(number, optional): Download timeout in millisecondstimeout
# Download Google Doc as 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) mcp__gdrive__drive_files_download( file_id="sheet123", local_path="/tmp/data.xlsx", export_format="xlsx" )
mcp__gdrive__drive_files_upload
mcp__gdrive__drive_files_uploadUpload local files with automatic CSV→Sheets conversion.
Parameters:
(string, required): Path to local filelocal_path
(string, optional): Name in Drive (defaults to filename)name
(string, optional): Parent folder IDparent_folder_id
(string, optional): File descriptiondescription
(boolean, optional): Convert CSV to Sheetsconvert_to_google_format
(string, optional): MIME type (auto-detected)mime_type
# Upload CSV and convert to Google Sheet mcp__gdrive__drive_files_upload( local_path="/tmp/data.csv", name="Sales Data 2025", convert_to_google_format=True )
mcp__gdrive__drive_files_copy
mcp__gdrive__drive_files_copyCreate file/folder copies with optional renaming.
Parameters:
(string, required): ID of file to copyfile_id
(string, optional): Name for copyname
(string, optional): Destination folderparent_folder_id
mcp__gdrive__drive_files_copy( file_id="abc123", name="Backup Copy", parent_folder_id="folder456" )
mcp__gdrive__drive_files_rename
mcp__gdrive__drive_files_renameRename files and folders.
Parameters:
(string, required): ID of file to renamefile_id
(string, required): New namename
mcp__gdrive__drive_files_rename( file_id="abc123", name="Updated Document Name" )
mcp__gdrive__drive_files_delete
mcp__gdrive__drive_files_deleteDelete files/folders (trash or permanent).
Parameters:
(string, required): ID of file to deletefile_id
(boolean, optional): Permanent delete vs trash (default: false)permanently
# Move to trash mcp__gdrive__drive_files_delete(file_id="abc123") # Permanently delete mcp__gdrive__drive_files_delete(file_id="abc123", permanently=True)
mcp__gdrive__drive_files_metadata
mcp__gdrive__drive_files_metadataGet comprehensive file metadata.
Parameters:
(string, required): File IDfile_id
mcp__gdrive__drive_files_metadata(file_id="abc123")
Returns: Name, size, mimeType, created/modified times, owner, sharing settings
mcp__gdrive__drive_files_validate_markdown
mcp__gdrive__drive_files_validate_markdownValidate Google Docs export to markdown compatibility.
Parameters:
(string, required): Google Doc file IDfile_id
mcp__gdrive__drive_files_validate_markdown(file_id="doc123")
Returns: Compatibility score and recommendations
mcp__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 IDfile_id
mcp__gdrive__drive_files_list_tabs(file_id="doc123")
Google Drive Folder Operations
mcp__gdrive__drive_folders_create
mcp__gdrive__drive_folders_createCreate folders with optional descriptions.
Parameters:
(string, required): Folder namename
(string, optional): Parent folder IDparent_folder_id
(string, optional): Folder descriptiondescription
mcp__gdrive__drive_folders_create( name="Project Documents", description="All project files" )
mcp__gdrive__drive_folders_move
mcp__gdrive__drive_folders_moveMove files/folders between locations.
Parameters:
(string, required): ID of file/folder to movefile_id
(string, required): Destination folder IDnew_parent_folder_id
(boolean, optional): Remove from current parents (default: true)remove_from_current_parents
mcp__gdrive__drive_folders_move( file_id="abc123", new_parent_folder_id="folder456" )
Permissions Management
mcp__gdrive__permissions_grant
mcp__gdrive__permissions_grantGrant user/group/domain access to files.
Parameters:
(string, required): File IDfile_id
(string, required): reader, writer, commenter, ownerrole
(string, required): user, group, domain, anyonetype
(string, optional): Email address (for user/group)email
(string, optional): Domain name or "current"domain
# Grant write access to user 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" )
mcp__gdrive__permissions_list
mcp__gdrive__permissions_listList current file/folder permissions.
Parameters:
(string, required): File IDfile_id
mcp__gdrive__permissions_list(file_id="abc123")
Returns: List of permissions with roles and email addresses
mcp__gdrive__permissions_update
mcp__gdrive__permissions_updateModify existing permission roles.
Parameters:
(string, required): File IDfile_id
(string, required): Permission IDpermission_id
(string, required): New role (reader, writer, commenter)role
mcp__gdrive__permissions_update( file_id="abc123", permission_id="perm456", role="commenter" )
mcp__gdrive__permissions_revoke
mcp__gdrive__permissions_revokeRemove user/group access.
Parameters:
(string, required): File IDfile_id
(string, required): Permission ID to removepermission_id
mcp__gdrive__permissions_revoke( file_id="abc123", permission_id="perm456" )
Google Docs Operations
mcp__gdrive__docs_create
mcp__gdrive__docs_createCreate Google Docs from markdown files.
Parameters:
(string, required): Path to markdown filelocal_path
(string, required): Document namename
(string, optional): Parent folder IDparent_folder_id
mcp__gdrive__docs_create( local_path="/tmp/notes.md", name="Meeting Notes", parent_folder_id="folder123" )
mcp__gdrive__docs_download
mcp__gdrive__docs_downloadDownload Docs as markdown with footnote conversion.
Parameters:
(string, required): Google Doc file IDfile_id
(string, required): Output pathlocal_path
(string, optional): Export format (markdown, pdf, docx)export_format
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_diffUpdate document content remotely without downloading.
Parameters:
(string, required): Google Doc file IDfile_id
(string, required): New text contentnew_content
(boolean, optional): Keep formatting (default: true)preserve_formatting
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_replaceFind and replace text with case-sensitive/insensitive matching.
Parameters:
(string, required): Google Doc file IDfile_id
(string, required): Text to findfind_text
(string, required): Replacement textreplace_text
(boolean, optional): Case-sensitive (default: false)match_case
(string, optional): Specific tab IDtab_id
# Case-insensitive replacement 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 )
Google Docs Comments
mcp__gdrive__docs_comments_list
mcp__gdrive__docs_comments_listList all comments on a document.
Parameters:
(string, required): File IDfile_id
(boolean, optional): Include deleted commentsinclude_deleted
(number, optional): Results per page (1-100)page_size
(string, optional): Pagination tokenpage_token
mcp__gdrive__docs_comments_list( file_id="doc123", page_size=50 )
mcp__gdrive__docs_comments_get
mcp__gdrive__docs_comments_getGet specific comment details.
Parameters:
(string, required): File IDfile_id
(string, required): Comment IDcomment_id
(boolean, optional): Include deleted repliesinclude_deleted
mcp__gdrive__docs_comments_get( file_id="doc123", comment_id="comment456" )
mcp__gdrive__docs_comments_create
mcp__gdrive__docs_comments_createAdd new comments to documents.
Parameters:
(string, required): File IDfile_id
(string, required): Comment textcontent
(string, optional): Anchor region for specific textanchor
# General comment mcp__gdrive__docs_comments_create( file_id="doc123", content="Please review this section" )
mcp__gdrive__docs_comments_reply
mcp__gdrive__docs_comments_replyReply to existing comments.
Parameters:
(string, required): File IDfile_id
(string, required): Comment IDcomment_id
(string, required): Reply textcontent
(string, optional): "resolve" or "reopen"action
# Reply and resolve mcp__gdrive__docs_comments_reply( file_id="doc123", comment_id="comment456", content="Fixed, thanks!", action="resolve" )
mcp__gdrive__docs_comments_resolve
mcp__gdrive__docs_comments_resolveMark comment as resolved.
Parameters:
(string, required): File IDfile_id
(string, required): Comment IDcomment_id
mcp__gdrive__docs_comments_resolve( file_id="doc123", comment_id="comment456" )
Google Sheets Operations
mcp__gdrive__sheets_create
mcp__gdrive__sheets_createCreate sheets with initial headers and data.
Parameters:
(string, required): Spreadsheet namename
(string, optional): Parent folder IDparent_folder_id
(array, optional): Column headersheaders
(2D array, optional): Initial data rowsdata
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_updateModify specific cells using A1 notation with formula support.
Parameters:
(string, required): Spreadsheet IDfile_id
(string, required): A1 notation (e.g., "Sheet1!A1:C3")range
(2D array, required): Cell valuesvalues
(string, optional): "RAW" or "USER_ENTERED" (default)input_option
# Update with formulas mcp__gdrive__sheets_update( file_id="sheet123", range="A1:B2", values=[ ["Product", "Price"], ["Widget", "=SUM(B3:B10)"] ], input_option="USER_ENTERED" )
mcp__gdrive__sheets_append
mcp__gdrive__sheets_appendAppend rows to end of data without range calculation.
Parameters:
(string, required): Spreadsheet IDfile_id
(2D array, required): Rows to appendvalues
(string, optional): Starting range (default: "Sheet1!A1")range
(string, optional): "RAW" or "USER_ENTERED"input_option
mcp__gdrive__sheets_append( file_id="sheet123", values=[ ["New Customer", "new@example.com", "Active"], ["Another Customer", "another@example.com", "Pending"] ] )
Google Calendar Operations
mcp__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 tokenpage_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
# 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 )
mcp__gdrive__calendar_search
mcp__gdrive__calendar_searchSearch events by text query with advanced filters.
Parameters:
(string, optional): Free-text search queryq
(string, optional): Calendar ID (default: "primary")calendar_id
(string, optional): Start timetime_min
(string, optional): End timetime_max
(number, optional): Max results (1-2500)max_results
mcp__gdrive__calendar_search( q="team meeting", time_min="2025-01-01T00:00:00Z", max_results=10 )
mcp__gdrive__calendar_create
mcp__gdrive__calendar_createCreate events with recurrence support.
Parameters:
(string, required): Event titlesummary
(string, required): Start time (RFC3339)start
(string, required): End time (RFC3339)end
(string, optional): Calendar IDcalendar_id
(string, optional): Event descriptiondescription
(string, optional): Event locationlocation
(object, optional): Recurrence patternrecurrence
# Create single event 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} )
mcp__gdrive__calendar_update
mcp__gdrive__calendar_updateModify existing calendar events.
Parameters:
(string, required): Event IDevent_id
(string, optional): Calendar IDcalendar_id
(string, optional): New titlesummary
(string, optional): New start timestart
(string, optional): New end timeend
(string, optional): New descriptiondescription
mcp__gdrive__calendar_update( event_id="event123", summary="Updated Meeting Title", start="2025-11-10T15:00:00Z" )
mcp__gdrive__calendar_delete
mcp__gdrive__calendar_deleteRemove events from calendar.
Parameters:
(string, required): Event IDevent_id
(string, optional): Calendar IDcalendar_id
mcp__gdrive__calendar_delete(event_id="event123")
mcp__gdrive__calendar_update_reminders
mcp__gdrive__calendar_update_remindersModify event reminder settings.
Parameters:
(string, required): Event IDevent_id
(string, optional): Calendar IDcalendar_id
(boolean, required): Use calendar defaultsuse_default
(array, optional): Custom reminders (method, minutes)overrides
(string, optional): "none", "all", "externalOnly"send_updates
# Disable all reminders 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} ] )
Gmail Operations
mcp__gdrive__gmail_search
mcp__gdrive__gmail_searchSearch messages with advanced query syntax.
Parameters:
(string, required): Gmail search queryquery
(number, optional): Max messages to returnmax_results
# Search by sender and subject 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" )
mcp__gdrive__gmail_get
mcp__gdrive__gmail_getGet full message content with headers.
Parameters:
(string, required): Gmail message IDmessage_id
mcp__gdrive__gmail_get(message_id="msg123")
Returns: Complete message with headers, body, attachments metadata
mcp__gdrive__gmail_thread
mcp__gdrive__gmail_threadGet entire conversation thread.
Parameters:
(string, required): Gmail thread IDthread_id
mcp__gdrive__gmail_thread(thread_id="thread123")
mcp__gdrive__gmail_send
mcp__gdrive__gmail_sendSend new messages with attachments.
Parameters:
(string, required): Recipient email(s)to
(string, required): Email subjectsubject
(string, required): Message bodybody
(string, optional): CC recipientscc
(string, optional): BCC recipientsbcc
(array, optional): File paths to attachattachments
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_draftCreate draft messages.
Parameters:
(string, required): Recipient emailto
(string, required): Email subjectsubject
(string, required): Message bodybody
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_draftSend existing drafts.
Parameters:
(string, required): Draft IDdraft_id
mcp__gdrive__gmail_send_draft(draft_id="draft123")
mcp__gdrive__gmail_list_labels
mcp__gdrive__gmail_list_labelsList all Gmail labels.
# No parameters required mcp__gdrive__gmail_list_labels()
mcp__gdrive__gmail_label
mcp__gdrive__gmail_labelAdd/remove labels on messages.
Parameters:
(string, required): Message IDmessage_id
(array, optional): Labels to addadd_labels
(array, optional): Labels to removeremove_labels
mcp__gdrive__gmail_label( message_id="msg123", add_labels=["IMPORTANT"], remove_labels=["INBOX"] )
mcp__gdrive__gmail_archive
mcp__gdrive__gmail_archiveArchive messages (remove from inbox).
Parameters:
(string, required): Message IDmessage_id
mcp__gdrive__gmail_archive(message_id="msg123")
mcp__gdrive__gmail_star
mcp__gdrive__gmail_starStar/unstar messages.
Parameters:
(string, required): Message IDmessage_id
(boolean, optional): Unstar message (default: false)unstar
# Star message mcp__gdrive__gmail_star(message_id="msg123") # Unstar message mcp__gdrive__gmail_star(message_id="msg123", unstar=True)
mcp__gdrive__gmail_trash
mcp__gdrive__gmail_trashMove messages to trash.
Parameters:
(string, required): Message IDmessage_id
mcp__gdrive__gmail_trash(message_id="msg123")
mcp__gdrive__gmail_delete
mcp__gdrive__gmail_deletePermanently delete messages.
Parameters:
(string, required): Message IDmessage_id
mcp__gdrive__gmail_delete(message_id="msg123")
mcp__gdrive__gmail_download_attachment
mcp__gdrive__gmail_download_attachmentDownload message attachments.
Parameters:
(string, required): Message IDmessage_id
(string, required): Attachment IDattachment_id
(string, required): Local output pathoutput_path
mcp__gdrive__gmail_download_attachment( message_id="msg123", attachment_id="attach456", output_path="/tmp/document.pdf" )
Google Tasks Operations
mcp__gdrive__tasks_list_lists
mcp__gdrive__tasks_list_listsList all task lists.
# No parameters required mcp__gdrive__tasks_list_lists()
mcp__gdrive__tasks_get_list
mcp__gdrive__tasks_get_listGet specific task list details.
Parameters:
(string, required): Task list IDtask_list_id
mcp__gdrive__tasks_get_list(task_list_id="list123")
mcp__gdrive__tasks_list
mcp__gdrive__tasks_listList tasks in a task list.
Parameters:
(string, required): Task list IDtask_list_id
(boolean, optional): Include completed tasksshow_completed
(boolean, optional): Include deleted tasksshow_deleted
(boolean, optional): Include hidden tasksshow_hidden
mcp__gdrive__tasks_list( task_list_id="list123", show_completed=True )
mcp__gdrive__tasks_get
mcp__gdrive__tasks_getGet specific task details.
Parameters:
(string, required): Task list IDtask_list_id
(string, required): Task IDtask_id
mcp__gdrive__tasks_get( task_list_id="list123", task_id="task456" )
mcp__gdrive__tasks_create_list
mcp__gdrive__tasks_create_listCreate new task lists.
Parameters:
(string, required): Task list titletitle
mcp__gdrive__tasks_create_list(title="Q1 Goals")
mcp__gdrive__tasks_create
mcp__gdrive__tasks_createCreate new tasks with due dates.
Parameters:
(string, required): Task list IDtask_list_id
(string, required): Task titletitle
(string, optional): Task notesnotes
(string, optional): Due date (RFC3339)due
(string, optional): Parent task IDparent
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_updateModify existing tasks.
Parameters:
(string, required): Task list IDtask_list_id
(string, required): Task IDtask_id
(string, optional): New titletitle
(string, optional): New notesnotes
(string, optional): New due datedue
(string, optional): "needsAction" or "completed"status
mcp__gdrive__tasks_update( task_list_id="list123", task_id="task456", title="Updated Task Title", status="completed" )
mcp__gdrive__tasks_complete
mcp__gdrive__tasks_completeMark tasks as completed.
Parameters:
(string, required): Task list IDtask_list_id
(string, required): Task IDtask_id
mcp__gdrive__tasks_complete( task_list_id="list123", task_id="task456" )
mcp__gdrive__tasks_delete
mcp__gdrive__tasks_deleteDelete tasks.
Parameters:
(string, required): Task list IDtask_list_id
(string, required): Task IDtask_id
mcp__gdrive__tasks_delete( task_list_id="list123", task_id="task456" )
mcp__gdrive__tasks_clear_completed
mcp__gdrive__tasks_clear_completedClear all completed tasks from a list.
Parameters:
(string, required): Task list IDtask_list_id
mcp__gdrive__tasks_clear_completed(task_list_id="list123")
XLSX File Operations
mcp__gdrive__parse_xlsx
mcp__gdrive__parse_xlsxParse Excel (.xlsx) file contents.
Parameters:
(string, required): Google Drive file ID of .xlsx filefile_id
mcp__gdrive__parse_xlsx(file_id="spreadsheet123")
Returns: Structured data from Excel file (sheets, rows, columns)
mcp__gdrive__write_xlsx
mcp__gdrive__write_xlsxCreate XLSX file from JSON workbook structure.
Parameters:
(object, required): Workbook structure with sheets arrayworkbook
(string, required): Absolute path where XLSX should be createdfile_path
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
Authentication
# Check authentication status gspace auth check # Login (interactive) gspace auth login
Drive File Operations
# List files gspace drive files ls gspace drive files ls --owner user@example.com --limit 20 # Download files (accepts file IDs or full Google URLs) 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 # 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 # Get metadata gspace drive files metadata FILE_ID
Drive Folders
# Create folder gspace drive folders create "Project Documents" # Move file to folder gspace drive folders move FILE_ID FOLDER_ID
Permissions
# 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 # List permissions gspace permissions list FILE_ID # Update permission gspace permissions update FILE_ID PERMISSION_ID --role commenter # Revoke permission gspace permissions revoke FILE_ID PERMISSION_ID
Google Docs
# Create doc from markdown gspace docs create /path/to/notes.md "Document Title" # Download doc as markdown (specialized command, auto-handles single/multi-tab docs) 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) 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 # 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
Google Sheets
# Create sheet gspace sheets create "Sales Data" --headers "Product,Price,Quantity" # Update cells 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"]]'
Google Calendar
# List events gspace calendar list --time-min 2025-01-01T00:00:00Z gspace calendar today gspace calendar tomorrow # Search events 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" # Update/delete events gspace calendar update EVENT_ID --summary "New Title" gspace calendar delete EVENT_ID # Update reminders gspace calendar update-reminders EVENT_ID --disable
Gmail
# Search emails gspace gmail search --query "from:boss@company.com subject:urgent" # Get message/thread 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 # Draft management 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 # Labels gspace gmail list-labels # Download attachment gspace gmail download-attachment MESSAGE_ID ATTACHMENT_ID /tmp/file.pdf
Google Tasks
# List task lists gspace tasks list-lists # List tasks 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" # 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 # Clear completed gspace tasks clear-completed TASK_LIST_ID
Common Workflows
Workflow 1: Find and Download Documents (MCP)
# 1. Search for documents files = mcp__gdrive__drive_files_list( query="Q4 report", type="application/vnd.google-apps.document", limit=10 ) # 2. Download as markdown mcp__gdrive__drive_files_download( file_id=files[0].id, local_path="/tmp/report.md", export_format="markdown" )
Workflow 2: Email Task Management (MCP)
# 1. Search for emails with actionable items messages = mcp__gdrive__gmail_search( query="subject:TODO is:unread", max_results=20 ) # 2. Create tasks from emails 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)
Workflow 3: Calendar Event Cleanup (MCP)
# 1. Search for "do not block" events events = mcp__gdrive__calendar_search( q="do not block", time_min="2025-01-01T00:00:00Z" ) # 2. Disable reminders for each event for event in events: mcp__gdrive__calendar_update_reminders( event_id=event.id, use_default=False, overrides=[] )
Workflow 4: Bulk File Permissions (CLI)
# Share all PDFs in folder with team 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
Workflow 5: Email Backup (CLI)
# 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
Best 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-Specific Best Practices
- Use appropriate limits: Set
orlimit
to 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 setspage_token
CLI-Specific Best Practices
- JSON output for scripting: Use
flag with--json
for processingjq - Confirm destructive operations: CLI prompts for confirmations by default
- Use environment variables: Set
for quota managementGOOGLE_CLOUD_PROJECT - Batch with shell loops: Combine CLI with shell scripts for bulk operations
Search Query Syntax
Drive Queries
- Search by filenamename contains 'text'
- Search file contentsfullText contains 'text'
- Filter by file typemimeType = 'application/pdf'
- Files in specific folder'folder-id' in parents
- Exclude trashed filestrashed = false
- Modified after datemodifiedTime > '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
Gmail Queries
- From specific senderfrom:sender@example.com
- To specific recipientto:recipient@example.com
- Subject contains keywordsubject:keyword
- Has attachmentshas:attachment
- Specific attachment typefilename:pdf
- Date filtersafter:2025/01/01
- Date filtersbefore:2025/12/31
- Unread messagesis:unread
- Starred messagesis:starred
- Specific labellabel:IMPORTANT
Error Handling
Common Errors
Authentication Errors:
# Check auth status mcp__gdrive__drive_check_auth()
File Not Found:
# Verify file exists try: metadata = mcp__gdrive__drive_files_metadata(file_id="abc123") except: # Handle missing file pass
Permission Denied:
# Re-authenticate with proper scopes gcloud auth login --enable-gdrive-access
Quick Reference
MCP Tools by Category
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
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