Google Workspace MCP Server
Provides full Gmail management: searching, reading, sending, replying, drafting, labeling and organizing messages and threads, plus attachment handling.
Authenticates with Google OAuth and reads from/writes to the Google Workspace APIs on the user's behalf across Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts and Chat.
Full Google Calendar management: list, create, update and delete events and calendars, including advanced features such as attendees, recurrence and reminders.
Creates and updates Google Slides presentations and manipulates their contents, including adding slides and managing text and layout.
Manages Google Tasks and task lists, allowing tasks to be created, updated, completed and organized in a hierarchy.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Workspace MCP Server schedule a meeting with Sarah tomorrow at 3pm and email her the agenda"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Workspace MCP Server
Full natural language control over Google Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Contacts, and Chat through all MCP clients, AI assistants and developer tools. Now includes a full featured CLI for use with tools like Claude Code and Codex!
The most feature-complete Google Workspace MCP server, with Remote OAuth2.1 multi-user support and 1-click Claude installation.
Support for all free Google accounts (Gmail, Docs, Drive etc) & Google Workspace plans (Starter, Standard, Plus, Enterprise, Non Profit) with expanded app options like Chat & Spaces. Interested in a private, managed cloud instance? That can be arranged.
See it in action:
A quick plug for AI-Enhanced Docs
This README was written with AI assistance, and here's why that matters
As a solo dev building open source tools, comprehensive documentation often wouldn't happen without AI help. Using agentic dev tools like Roo & Claude Code that understand the entire codebase, AI doesn't just regurgitate generic content - it extracts real implementation details and creates accurate, specific documentation.
In this case, Sonnet 4 took a pass & a human (me) verified them 2/16/26.
Overview
A production-ready MCP server that integrates all major Google Workspace services with AI assistants. It supports both single-user operation and multi-user authentication via OAuth 2.1, making it a powerful backend for custom applications. Built with FastMCP for optimal performance, featuring advanced authentication handling, service caching, and streamlined development patterns.
Simplified Setup: Now uses Google Desktop OAuth clients - no redirect URIs or port configuration needed!
Related MCP server: google-cli-mcp
Features
@ Gmail • ≡ Drive • ⧖ Calendar ≡ Docs
Complete Gmail management, end to end coverage
Full calendar management with advanced features
File operations with Office format support
Document creation, editing & comments
Deep, exhaustive support for fine grained editing
≡ Forms • @ Chat • ≡ Sheets • ≡ Slides
Form creation, publish settings & response management
Space management & messaging capabilities
Spreadsheet operations with flexible cell management
Presentation creation, updates & content manipulation
◆ Apps Script
Automate cross-application workflows with custom code
Execute existing business logic and custom functions
Manage script projects, deployments & versions
Debug and modify Apps Script code programmatically
Bridge Google Workspace services through automation
⊠ Authentication & Security
Advanced OAuth 2.0 & OAuth 2.1 support
Automatic token refresh & session management
Transport-aware callback handling
Multi-user bearer token authentication
Innovative CORS proxy architecture
✓ Tasks • 👤 Contacts • ◆ Custom Search
Task & task list management with hierarchy
Contact management via People API with groups
Programmable Search Engine (PSE) integration
Quick Start
Credentials
export GOOGLE_OAUTH_CLIENT_ID="..."
export GOOGLE_OAUTH_CLIENT_SECRET="..."Launch Commands
uvx workspace-mcp --tool-tier core
uv run main.py --tools gmail driveTool Tiers
core- Essential toolsextended- Core + extrascomplete- Everything Details →
Required Configuration
Required
Variable | Purpose |
| OAuth client ID from Google Cloud |
| OAuth client secret |
| Development only (allows |
Optional
Variable | Purpose |
| Default email for single-user auth |
| API key for Custom Search |
| Search Engine ID for Custom Search |
| Set to |
| Set to |
| Set to |
Claude Desktop stores these securely in the OS keychain; set them once in the extension pane.
One-Click Claude Desktop Install (Claude Desktop Only, Stdio, Single User)
Download: Grab the latest
google_workspace_mcp.dxtfrom the “Releases” pageInstall: Double-click the file – Claude Desktop opens and prompts you to Install
Configure: In Claude Desktop → Settings → Extensions → Google Workspace MCP, paste your Google OAuth credentials
Use it: Start a new Claude chat and call any Google Workspace tool
Why DXT?
Desktop Extensions (
.dxt) bundle the server, dependencies, and manifest so users go from download → working MCP in one click – no terminal, no JSON editing, no version conflicts.
Prerequisites
Python 3.10+
Google Cloud Project with OAuth 2.0 credentials
Configuration
1. Create Project
console.cloud.google.com
→ Create new project
→ Note project name2. OAuth Credentials
APIs & Services → Credentials
→ Create Credentials
→ OAuth Client ID
→ Desktop ApplicationDownload & save credentials
3. Enable APIs
APIs & Services → Library
Search & enable:
Calendar, Drive, Gmail,
Docs, Sheets, Slides,
Forms, Tasks, People,
Chat, SearchSee quick links below
Complete Setup Process:
Create OAuth 2.0 Credentials - Visit Google Cloud Console
Create a new project (or use existing)
Navigate to APIs & Services → Credentials
Click Create Credentials → OAuth Client ID
Choose Desktop Application as the application type (no redirect URIs needed!)
Download credentials and note the Client ID and Client Secret
Enable Required APIs - In APIs & Services → Library
Search for and enable each required API
Or use the quick links below for one-click enabling
Configure Environment - Set your credentials:
export GOOGLE_OAUTH_CLIENT_ID="your-client-id" export GOOGLE_OAUTH_CLIENT_SECRET="your-secret"
1.1. Credentials: See Credential Configuration for detailed setup options
Environment Configuration:
◆ Development Mode
export OAUTHLIB_INSECURE_TRANSPORT=1Allows HTTP redirect URIs
@ Default User
export USER_GOOGLE_EMAIL=\
your.email@gmail.comSingle-user authentication
◆ Custom Search
export GOOGLE_PSE_API_KEY=xxx
export GOOGLE_PSE_ENGINE_ID=yyyOptional: Search API setup
Server Configuration:
◆ Base Configuration
export WORKSPACE_MCP_BASE_URI=
http://localhost
export WORKSPACE_MCP_PORT=8000
export WORKSPACE_MCP_HOST=0.0.0.0 # Use 127.0.0.1 for localhost-onlyServer URL & port settings
↻ Proxy Support
export MCP_ENABLE_OAUTH21=
trueLeverage multi-user OAuth2.1 clients
@ Default Email
export USER_GOOGLE_EMAIL=\
your.email@gmail.comSkip email in auth flows in single user mode
Variable | Description | Default |
| Base server URI (no port) |
|
| Server listening port |
|
| Server bind host |
|
| External URL for reverse proxy setups | None |
| Directory for downloaded attachments |
|
| Override OAuth callback URL | Auto-constructed |
| Default auth email | None |
Google Custom Search Setup
1. Create Search Engine
programmablesearchengine.google.com
/controlpanel/create
→ Configure sites or entire web
→ Note your Engine ID (cx)2. Get API Key
developers.google.com
/custom-search/v1/overview
→ Create/select project
→ Enable Custom Search API
→ Create credentials (API Key)3. Set Variables
export GOOGLE_PSE_API_KEY=\
"your-api-key"
export GOOGLE_PSE_ENGINE_ID=\
"your-engine-id"Configure in environment
Complete Setup Process:
Create Search Engine - Visit the Control Panel
Choose "Search the entire web" or specify sites
Copy the Search Engine ID (looks like:
017643444788157684527:6ivsjbpxpqw)
Enable API & Get Key - Visit Google Developers Console
Enable "Custom Search API" in your project
Create credentials → API Key
Restrict key to Custom Search API (recommended)
Configure Environment - Add to your shell or
.env:export GOOGLE_PSE_API_KEY="AIzaSy..." export GOOGLE_PSE_ENGINE_ID="01764344478..."
Start the Server
📌 Transport Mode Guidance: Use streamable HTTP mode (
--transport streamable-http) for all modern MCP clients including Claude Code, VS Code MCP, and MCP Inspector. Stdio mode is only for clients with incomplete MCP specification support.
▶ Legacy Mode
uv run main.py⚠️ Stdio mode (incomplete MCP clients only)
◆ HTTP Mode (Recommended)
uv run main.py \
--transport streamable-http✅ Full MCP spec compliance & OAuth 2.1
@ Single User
uv run main.py \
--single-userSimplified authentication ⚠️ Cannot be used with OAuth 2.1 mode
▶ Selective Tool Loading
# Load specific services only
uv run main.py --tools gmail drive calendar
uv run main.py --tools sheets docs
# Combine with other flags
uv run main.py --single-user --tools gmail🔒 Read-Only Mode
# Requests only read-only scopes & disables write tools
uv run main.py --read-only
# Combine with specific tools or tiers
uv run main.py --tools gmail drive --read-only
uv run main.py --tool-tier core --read-onlyRead-only mode provides secure, restricted access by:
Requesting only
*.readonlyOAuth scopes (e.g.,gmail.readonly,drive.readonly)Automatically filtering out tools that require write permissions at startup
Allowing read operations: list, get, search, and export across all services
★ Tool Tiers
uv run main.py --tool-tier core # ● Essential tools only
uv run main.py --tool-tier extended # ◐ Core + additional
uv run main.py --tool-tier complete # ○ All available tools◆ Docker Deployment
docker build -t workspace-mcp .
docker run -p 8000:8000 -v $(pwd):/app \
workspace-mcp --transport streamable-http
# With tool selection via environment variables
docker run -e TOOL_TIER=core workspace-mcp
docker run -e TOOLS="gmail drive calendar" workspace-mcpAvailable Services: gmail • drive • calendar • docs • sheets • forms • tasks • contacts • chat • search
CLI Mode
The server supports a CLI mode for direct tool invocation without running the full MCP server. This is ideal for scripting, automation, and use by coding agents (Codex, Claude Code).
▶ List Tools
workspace-mcp --cli
workspace-mcp --cli list
workspace-mcp --cli list --jsonView all available tools
◆ Tool Help
workspace-mcp --cli search_gmail_messages --helpShow parameters and documentation
▶ Run with Arguments
workspace-mcp --cli search_gmail_messages \
--args '{"query": "is:unread"}'Execute tool with inline JSON
◆ Pipe from Stdin
echo '{"query": "is:unread"}' | \
workspace-mcp --cli search_gmail_messagesPass arguments via stdin
Command Structure:
workspace-mcp --cli [command] [options]Commands:
Command | Description |
| List all available tools |
| Execute the specified tool |
| Show detailed help for a tool |
Options:
Option | Description |
| JSON string with tool arguments |
| Output in JSON format (for |
| Show help for a tool |
Examples:
# List all Gmail tools
workspace-mcp --cli list | grep gmail
# Search for unread emails
workspace-mcp --cli search_gmail_messages --args '{"query": "is:unread", "max_results": 5}'
# Get calendar events for today
workspace-mcp --cli get_events --args '{"calendar_id": "primary", "time_min": "2024-01-15T00:00:00Z"}'
# Create a Drive file from a URL
workspace-mcp --cli create_drive_file --args '{"name": "doc.pdf", "source_url": "https://example.com/file.pdf"}'
# Combine with jq for processing
workspace-mcp --cli list --json | jq '.tools[] | select(.name | contains("gmail"))'Notes:
CLI mode uses OAuth 2.0 (same credentials as server mode)
Authentication flows work the same way - browser opens for first-time auth
Results are printed to stdout; errors go to stderr
Exit code 0 on success, 1 on error
Tool Tiers
The server organizes tools into three progressive tiers for simplified deployment. Choose a tier that matches your usage needs and API quota requirements.
Available Tiers
● Core (--tool-tier core)
Essential tools for everyday tasks. Perfect for light usage with minimal API quotas. Includes search, read, create, and basic modify operations across all services.
● Extended (--tool-tier extended)
Core functionality plus management tools. Adds labels, folders, batch operations, and advanced search. Ideal for regular usage with moderate API needs.
● Complete (--tool-tier complete)
Full API access including comments, headers/footers, publishing settings, and administrative functions. For power users needing maximum functionality.
Important Notes
▶ Start with core and upgrade as needed
▶ Tiers are cumulative – each includes all previous
▶ Mix and match with --tools for specific services
▶ Configuration in core/tool_tiers.yaml
▶ Authentication included in all tiers
Usage Examples
# Basic tier selection
uv run main.py --tool-tier core # Start with essential tools only
uv run main.py --tool-tier extended # Expand to include management features
uv run main.py --tool-tier complete # Enable all available functionality
# Selective service loading with tiers
uv run main.py --tools gmail drive --tool-tier core # Core tools for specific services
uv run main.py --tools gmail --tool-tier extended # Extended Gmail functionality only
uv run main.py --tools docs sheets --tool-tier complete # Full access to Docs and Sheets📋 Credential Configuration
🚀 Environment Variables
export GOOGLE_OAUTH_CLIENT_ID=\
"your-client-id"
export GOOGLE_OAUTH_CLIENT_SECRET=\
"your-secret"Best for production
📁 File-based
# Download & place in project root
client_secret.json
# Or specify custom path
export GOOGLE_CLIENT_SECRET_PATH=\
/path/to/secret.jsonTraditional method
⚡ .env File
cp .env.oauth21 .env
# Edit .env with credentialsBest for development
Loading Priority
Environment variables (
export VAR=value).envfile in project root (warning - if you run viauvxrather thanuv runfrom the repo directory, you are spawning a standalone process not associated with your clone of the repo and it will not find your .env file without specifying it directly)client_secret.jsonviaGOOGLE_CLIENT_SECRET_PATHDefault
client_secret.jsonin project root
Why Environment Variables?
✅ Docker/K8s ready - Native container support
✅ Cloud platforms - Heroku, Railway, Vercel
✅ CI/CD pipelines - GitHub Actions, Jenkins
✅ No secrets in git - Keep credentials secure
✅ Easy rotation - Update without code changes
🧰 Available Tools
Note: All tools support automatic authentication via
@require_google_service()decorators with 30-minute service caching.
📅 Google Calendar calendar_tools.py
Tool | Tier | Description |
| Core | List accessible calendars |
| Core | Retrieve events with time range filtering |
| Core | Create events with attachments & reminders |
| Core | Update existing events |
| Extended | Remove events |
📁 Google Drive drive_tools.py
Tool | Tier | Description |
| Core | Search files with query syntax |
| Core | Read file content (Office formats) |
| Core | Download Drive files to local disk |
| Core | Create files or fetch from URLs |
| Core | Create empty folders in Drive or shared drives |
| Core | Import files (MD, DOCX, HTML, etc.) as Google Docs |
| Core | Share file with users/groups/domains/anyone |
| Core | Get shareable links for a file |
| Extended | List folder contents |
| Extended | Copy existing files (templates) with optional renaming |
| Extended | Update file metadata, move between folders |
| Extended | Share file with multiple recipients |
| Extended | Modify permission role |
| Extended | Revoke file access |
| Extended | Transfer file ownership to another user |
| Extended | Set link sharing and file-level sharing settings |
| Complete | Get detailed file permissions |
| Complete | Check public sharing status |
📧 Gmail gmail_tools.py
Tool | Tier | Description |
| Core | Search with Gmail operators |
| Core | Retrieve message content |
| Core | Batch retrieve message content |
| Core | Send emails |
| Extended | Get full thread content |
| Extended | Modify message labels |
| Extended | List available labels |
| Extended | Create/update/delete labels |
| Extended | Create drafts |
| Complete | Batch retrieve thread content |
| Complete | Batch modify labels |
| Complete | Legacy OAuth 2.0 auth (disabled when OAuth 2.1 is enabled) |
Both send_gmail_message and draft_gmail_message support attachments via two methods:
Option 1: File Path (local server only)
attachments=[{"path": "/path/to/report.pdf"}]Reads file from disk, auto-detects MIME type. Optional filename override.
Option 2: Base64 Content (works everywhere)
attachments=[{
"filename": "report.pdf",
"content": "JVBERi0xLjQK...", # base64-encoded
"mime_type": "application/pdf" # optional
}]⚠️ Centrally Hosted Servers: When the MCP server runs remotely (cloud, shared instance), it cannot access your local filesystem. Use Option 2 with base64-encoded content. Your MCP client must encode files before sending.
When downloading Gmail attachments (get_gmail_attachment_content) or Drive files (get_drive_file_download_url), files are saved to a persistent local directory rather than a temporary folder in the working directory.
Default location: ~/.workspace-mcp/attachments/
Files are saved with their original filename plus a short UUID suffix for uniqueness (e.g., invoice_a1b2c3d4.pdf). In stdio mode, the tool returns the absolute file path for direct filesystem access. In HTTP mode, it returns a download URL via the /attachments/{file_id} endpoint.
To customize the storage directory:
export WORKSPACE_ATTACHMENT_DIR="/path/to/custom/dir"Saved files expire after 1 hour and are cleaned up automatically.
📝 Google Docs docs_tools.py
Tool | Tier | Description |
| Core | Extract document text |
| Core | Create new documents |
| Core | Modify document text (formatting + links) |
| Extended | Find documents by name |
| Extended | Find and replace text |
| Extended | List docs in folder |
| Extended | Add tables, lists, page breaks |
| Extended | Apply heading styles, lists (bulleted/numbered with nesting), and paragraph formatting |
| Extended | Export document as formatted Markdown with optional comments |
| Complete | Insert images from Drive/URLs |
| Complete | Modify headers and footers |
| Complete | Execute multiple operations |
| Complete | Analyze document structure |
| Extended | Export document to PDF |
| Complete | Create data tables |
| Complete | Debug table issues |
| Complete | Read, Reply, Create, Resolve |
📊 Google Sheets sheets_tools.py
Tool | Tier | Description |
| Core | Read cell ranges |
| Core | Write/update/clear cells |
| Core | Create new spreadsheets |
| Extended | List accessible spreadsheets |
| Extended | Get spreadsheet metadata |
| Extended | Apply colors, number formats, text wrapping, alignment, bold/italic, font size |
| Complete | Add sheets to existing files |
| Complete | Read/create/reply/resolve comments |
🖼️ Google Slides slides_tools.py
Tool | Tier | Description |
| Core | Create new presentations |
| Core | Retrieve presentation details |
| Extended | Apply multiple updates |
| Extended | Get specific slide information |
| Extended | Generate slide thumbnails |
| Complete | Read/create/reply/resolve comments |
📝 Google Forms forms_tools.py
Tool | Tier | Description |
| Core | Create new forms |
| Core | Retrieve form details & URLs |
| Complete | Configure form settings |
| Complete | Get individual responses |
| Extended | List all responses with pagination |
| Complete | Apply batch updates (questions, settings) |
✓ Google Tasks tasks_tools.py
Tool | Tier | Description |
| Core | List tasks with filtering |
| Core | Retrieve task details |
| Core | Create tasks with hierarchy |
| Core | Modify task properties |
| Extended | Remove tasks |
| Complete | Reposition tasks |
| Complete | Hide completed tasks |
| Complete | List/get/create/update/delete task lists |
👤 Google Contacts contacts_tools.py
Tool | Tier | Description |
| Core | Search contacts by name, email, phone |
| Core | Retrieve detailed contact info |
| Core | List contacts with pagination |
| Core | Create new contacts |
| Extended | Update existing contacts |
| Extended | Delete contacts |
| Extended | List contact groups/labels |
| Extended | Get group details with members |
| Complete | Batch create/update/delete contacts |
| Complete | Create/update/delete contact groups |
| Complete | Add/remove contacts from groups |
💬 Google Chat chat_tools.py
Tool | Tier | Description |
| Extended | List chat spaces/rooms |
| Core | Retrieve space messages |
| Core | Send messages to spaces |
| Core | Search across chat history |
| Core | Add emoji reaction to a message |
| Extended | Download attachment from a chat message |
🔍 Google Custom Search search_tools.py
Tool | Tier | Description |
| Core | Perform web searches |
| Complete | Retrieve search engine metadata |
| Extended | Search within specific domains |
Google Apps Script apps_script_tools.py
Tool | Tier | Description |
| Core | List accessible Apps Script projects |
| Core | Get complete project with all files |
| Core | Retrieve specific file content |
| Core | Create new standalone or bound project |
| Core | Update or create script files |
| Core | Execute function with parameters |
| Extended | Create new script deployment |
| Extended | List all project deployments |
| Extended | Update deployment configuration |
| Extended | Remove deployment |
| Extended | View recent executions and status |
Tool Tier Legend:
• Core: Essential tools for basic functionality • Minimal API usage • Getting started
• Extended: Core tools + additional features • Regular usage • Expanded capabilities
• Complete: All available tools including advanced features • Power users • Full API access
Connect to Claude Desktop
The server supports two transport modes:
Stdio Mode (Legacy - For Clients with Incomplete MCP Support)
⚠️ Important: Stdio mode is a legacy fallback for clients that don't properly implement the MCP specification with OAuth 2.1 and streamable HTTP support. Claude Code and other modern MCP clients should use streamable HTTP mode (
--transport streamable-http) for proper OAuth flow and multi-user support.
In general, you should use the one-click DXT installer package for Claude Desktop.
If you are unable to for some reason, you can configure it manually via claude_desktop_config.json
Manual Claude Configuration (Alternative)
Open Claude Desktop Settings → Developer → Edit Config
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the server configuration:
{
"mcpServers": {
"google_workspace": {
"command": "uvx",
"args": ["workspace-mcp"],
"env": {
"GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
"GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
"OAUTHLIB_INSECURE_TRANSPORT": "1"
}
}
}
}Connect to LM Studio
Add a new MCP server in LM Studio (Settings → MCP Servers) using the same JSON format:
{
"mcpServers": {
"google_workspace": {
"command": "uvx",
"args": ["workspace-mcp"],
"env": {
"GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
"GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
"OAUTHLIB_INSECURE_TRANSPORT": "1",
}
}
}
}2. Advanced / Cross-Platform Installation
If you’re developing, deploying to servers, or using another MCP-capable client, keep reading.
Instant CLI (uvx)
# Requires Python 3.10+ and uvx
# First, set credentials (see Credential Configuration above)
uvx workspace-mcp --tool-tier core # or --tools gmail drive calendarNote: Configure OAuth credentials before running. Supports environment variables,
.envfile, orclient_secret.json.
Local Development Setup
# Install everything needed for linting, tests, and release tooling
uv sync --group dev
# Run the same linter that git hooks invoke automatically
uv run ruff check .
# Execute the full test suite (async fixtures require pytest-asyncio)
uv run pytestuv sync --group testinstalls only the testing stack if you need a slimmer environment.uv run main.py --transport streamable-httplaunches the server with your checked-out code for manual verification.Ruff is part of the
devgroup because pre-push hooks callruff checkautomatically—run it locally before committing to avoid hook failures.
OAuth 2.1 Support (Multi-User Bearer Token Authentication)
The server includes OAuth 2.1 support for bearer token authentication, enabling multi-user session management. OAuth 2.1 automatically reuses your existing GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET credentials - no additional configuration needed!
When to use OAuth 2.1:
Multiple users accessing the same MCP server instance
Need for bearer token authentication instead of passing user emails
Building web applications or APIs on top of the MCP server
Production environments requiring secure session management
Browser-based clients requiring CORS support
⚠️ Important: OAuth 2.1 and Single-User Mode are mutually exclusive
OAuth 2.1 mode (MCP_ENABLE_OAUTH21=true) cannot be used together with the --single-user flag:
Single-user mode: For legacy clients that pass user emails in tool calls
OAuth 2.1 mode: For modern multi-user scenarios with bearer token authentication
Choose one authentication method - using both will result in a startup error.
Enabling OAuth 2.1:
To enable OAuth 2.1, set the MCP_ENABLE_OAUTH21 environment variable to true.
# OAuth 2.1 requires HTTP transport mode
export MCP_ENABLE_OAUTH21=true
uv run main.py --transport streamable-httpIf MCP_ENABLE_OAUTH21 is not set to true, the server will use legacy authentication, which is suitable for clients that do not support OAuth 2.1.
FastMCP ships a native GoogleProvider that we now rely on directly. It solves the two tricky parts of using Google OAuth with MCP clients:
Dynamic Client Registration: Google still doesn't support OAuth 2.1 DCR, but the FastMCP provider exposes the full DCR surface and forwards registrations to Google using your fixed credentials. MCP clients register as usual and the provider hands them your Google client ID/secret under the hood.
CORS & Browser Compatibility: The provider includes an OAuth proxy that serves all discovery, authorization, and token endpoints with proper CORS headers. We no longer maintain custom
/oauth2/*routes—the provider handles the upstream exchanges securely and advertises the correct metadata to clients.
The result is a leaner server that still enables any OAuth 2.1 compliant client (including browser-based ones) to authenticate through Google without bespoke code.
Stateless Mode (Container-Friendly)
The server supports a stateless mode designed for containerized environments where file system writes should be avoided:
Enabling Stateless Mode:
# Stateless mode requires OAuth 2.1 to be enabled
export MCP_ENABLE_OAUTH21=true
export WORKSPACE_MCP_STATELESS_MODE=true
uv run main.py --transport streamable-httpKey Features:
No file system writes: Credentials are never written to disk
No debug logs: File-based logging is completely disabled
Memory-only sessions: All tokens stored in memory via OAuth 2.1 session store
Container-ready: Perfect for Docker, Kubernetes, and serverless deployments
Token per request: Each request must include a valid Bearer token
Requirements:
Must be used with
MCP_ENABLE_OAUTH21=trueIncompatible with single-user mode
Clients must handle OAuth flow and send valid tokens with each request
This mode is ideal for:
Cloud deployments where persistent storage is unavailable
Multi-tenant environments requiring strict isolation
Containerized applications with read-only filesystems
Serverless functions and ephemeral compute environments
MCP Inspector: No additional configuration needed with desktop OAuth client.
Claude Code: No additional configuration needed with desktop OAuth client.
OAuth Proxy Storage Backends
The server supports pluggable storage backends for OAuth proxy state management via FastMCP 2.13.0+. Choose a backend based on your deployment needs.
Available Backends:
Backend | Best For | Persistence | Multi-Server |
Memory | Development, testing | ❌ | ❌ |
Disk | Single-server production | ✅ | ❌ |
Valkey/Redis | Distributed production | ✅ | ✅ |
Configuration:
# Memory storage (fast, no persistence)
export WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=memory
# Disk storage (persists across restarts)
export WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=disk
export WORKSPACE_MCP_OAUTH_PROXY_DISK_DIRECTORY=~/.fastmcp/oauth-proxy
# Valkey/Redis storage (distributed, multi-server)
export WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=valkey
export WORKSPACE_MCP_OAUTH_PROXY_VALKEY_HOST=redis.example.com
export WORKSPACE_MCP_OAUTH_PROXY_VALKEY_PORT=6379Valkey support is optional. Install
workspace-mcp[valkey](orpy-key-value-aio[valkey]) only if you enable the Valkey backend. Windows: buildingvalkey-glidefrom source requires MSVC C++ build tools with C11 support. If you seeaws-lc-sysC11 errors, setCFLAGS=/std:c11.
Variable | Default | Description |
| localhost | Valkey/Redis host |
| 6379 | Port (6380 auto-enables TLS) |
| 0 | Database number |
| auto | Enable TLS (auto if port 6380) |
| - | Authentication username |
| - | Authentication password |
| 5000 | Request timeout for remote hosts |
| 10000 | Connection timeout for remote hosts |
Encryption: Disk and Valkey storage are encrypted with Fernet. The encryption key is derived from FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY if set, otherwise from GOOGLE_OAUTH_CLIENT_SECRET.
External OAuth 2.1 Provider Mode
The server supports an external OAuth 2.1 provider mode for scenarios where authentication is handled by an external system. In this mode, the MCP server does not manage the OAuth flow itself but expects valid bearer tokens in the Authorization header of tool calls.
Enabling External OAuth 2.1 Provider Mode:
# External OAuth provider mode requires OAuth 2.1 to be enabled
export MCP_ENABLE_OAUTH21=true
export EXTERNAL_OAUTH21_PROVIDER=true
uv run main.py --transport streamable-httpHow It Works:
Protocol-level auth disabled: MCP handshake (
initialize) andtools/listdo not require authenticationTool-level auth required: All tool calls must include
Authorization: Bearer <token>headerExternal OAuth flow: Your external system handles the OAuth flow and obtains Google access tokens
Token validation: Server validates bearer tokens via Google's tokeninfo API
Multi-user support: Each request is authenticated independently based on its bearer token
Key Features:
No local OAuth flow: Server does not provide OAuth callback endpoints or manage OAuth state
Bearer token only: All authentication via Authorization headers
Stateless by design: Works seamlessly with
WORKSPACE_MCP_STATELESS_MODE=trueExternal identity providers: Integrate with your existing authentication infrastructure
Tool discovery: Clients can list available tools without authentication
Requirements:
Must be used with
MCP_ENABLE_OAUTH21=trueOAuth credentials still required for token validation (
GOOGLE_OAUTH_CLIENT_ID,GOOGLE_OAUTH_CLIENT_SECRET)External system must obtain valid Google OAuth access tokens (ya29.*)
Each tool call request must include valid bearer token
Use Cases:
Integrating with existing authentication systems
Custom OAuth flows managed by your application
API gateways that handle authentication upstream
Multi-tenant SaaS applications with centralized auth
Mobile or web apps with their own OAuth implementation
VS Code MCP Client Support
✅ Recommended: VS Code MCP extension properly supports the full MCP specification. Always use HTTP transport mode for proper OAuth 2.1 authentication.
{
"servers": {
"google-workspace": {
"url": "http://localhost:8000/mcp/",
"type": "http"
}
}
}Note: Make sure to start the server with --transport streamable-http when using VS Code MCP.
Claude Code MCP Client Support
✅ Recommended: Claude Code is a modern MCP client that properly supports the full MCP specification. Always use HTTP transport mode with Claude Code for proper OAuth 2.1 authentication and multi-user support.
# Start the server in HTTP mode first
uv run main.py --transport streamable-http
# Then add to Claude Code
claude mcp add --transport http workspace-mcp http://localhost:8000/mcpReverse Proxy Setup
If you're running the MCP server behind a reverse proxy (nginx, Apache, Cloudflare, etc.), you have two configuration options:
Problem: When behind a reverse proxy, the server constructs OAuth URLs using internal ports (e.g., http://localhost:8000) but external clients need the public URL (e.g., https://your-domain.com).
Solution 1: Set WORKSPACE_EXTERNAL_URL for all OAuth endpoints:
# This configures all OAuth endpoints to use your external URL
export WORKSPACE_EXTERNAL_URL="https://your-domain.com"Solution 2: Set GOOGLE_OAUTH_REDIRECT_URI for just the callback:
# This only overrides the OAuth callback URL
export GOOGLE_OAUTH_REDIRECT_URI="https://your-domain.com/oauth2callback"You also have options for:
| OAUTH_CUSTOM_REDIRECT_URIS (optional) | Comma-separated list of additional redirect URIs |
| OAUTH_ALLOWED_ORIGINS (optional) | Comma-separated list of additional CORS origins |
Important:
Use
WORKSPACE_EXTERNAL_URLwhen all OAuth endpoints should use the external URL (recommended for reverse proxy setups)Use
GOOGLE_OAUTH_REDIRECT_URIwhen you only need to override the callback URLThe redirect URI must exactly match what's configured in your Google Cloud Console
Your reverse proxy must forward OAuth-related requests (
/oauth2callback,/oauth2/*,/.well-known/*) to the MCP server
# Configure credentials first (see Credential Configuration section)
# Start with specific tools only
uvx workspace-mcp --tools gmail drive calendar tasks
# Start with tool tiers (recommended for most users)
uvx workspace-mcp --tool-tier core # Essential tools
uvx workspace-mcp --tool-tier extended # Core + additional features
uvx workspace-mcp --tool-tier complete # All tools
# Start in HTTP mode for debugging
uvx workspace-mcp --transport streamable-httpRequires Python 3.10+ and uvx. The package is available on PyPI.
Development Installation
For development or customization:
git clone https://github.com/taylorwilsdon/google_workspace_mcp.git
cd google_workspace_mcp
uv run main.pyDevelopment Installation (For Contributors):
{
"mcpServers": {
"google_workspace": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/repo/google_workspace_mcp",
"main.py"
],
"env": {
"GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
"GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
"OAUTHLIB_INSECURE_TRANSPORT": "1"
}
}
}
}HTTP Mode (For debugging or web interfaces)
If you need to use HTTP mode with Claude Desktop:
{
"mcpServers": {
"google_workspace": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8000/mcp"]
}
}
}Note: Make sure to start the server with --transport streamable-http when using HTTP mode.
First-Time Authentication
The server uses Google Desktop OAuth for simplified authentication:
No redirect URIs needed: Desktop OAuth clients handle authentication without complex callback URLs
Automatic flow: The server manages the entire OAuth process transparently
Transport-agnostic: Works seamlessly in both stdio and HTTP modes
When calling a tool:
Server returns authorization URL
Open URL in browser and authorize
Google provides an authorization code
Paste the code when prompted (or it's handled automatically)
Server completes authentication and retries your request
◆ Development
Project Structure
google_workspace_mcp/
├── auth/ # Authentication system with decorators
├── core/ # MCP server and utilities
├── g{service}/ # Service-specific tools
├── main.py # Server entry point
├── client_secret.json # OAuth credentials (not committed)
└── pyproject.toml # DependenciesAdding New Tools
from auth.service_decorator import require_google_service
@require_google_service("drive", "drive_read") # Service + scope group
async def your_new_tool(service, param1: str, param2: int = 10):
"""Tool description"""
# service is automatically injected and cached
result = service.files().list().execute()
return result # Return native Python objectsArchitecture Highlights
Service Caching: 30-minute TTL reduces authentication overhead
Scope Management: Centralized in
SCOPE_GROUPSfor easy maintenanceError Handling: Native exceptions instead of manual error construction
Multi-Service Support:
@require_multiple_services()for complex tools
Credential Store System
The server includes an abstract credential store API and a default backend for managing Google OAuth credentials with support for multiple storage backends:
Features:
Abstract Interface:
CredentialStorebase class defines standard operations (get, store, delete, list users)Local File Storage:
LocalDirectoryCredentialStoreimplementation stores credentials as JSON filesConfigurable Storage: Environment variable
GOOGLE_MCP_CREDENTIALS_DIRsets storage locationMulti-User Support: Store and manage credentials for multiple Google accounts
Automatic Directory Creation: Storage directory is created automatically if it doesn't exist
Configuration:
# Optional: Set custom credentials directory
export GOOGLE_MCP_CREDENTIALS_DIR="/path/to/credentials"
# Default locations (if GOOGLE_MCP_CREDENTIALS_DIR not set):
# - ~/.google_workspace_mcp/credentials (if home directory accessible)
# - ./.credentials (fallback)Usage Example:
from auth.credential_store import get_credential_store
# Get the global credential store instance
store = get_credential_store()
# Store credentials for a user
store.store_credential("user@example.com", credentials)
# Retrieve credentials
creds = store.get_credential("user@example.com")
# List all users with stored credentials
users = store.list_users()The credential store automatically handles credential serialization, expiry parsing, and provides error handling for storage operations.
⊠ Security
Credentials: Never commit
.env,client_secret.jsonor the.credentials/directory to source control!OAuth Callback: Uses
http://localhost:8000/oauth2callbackfor development (requiresOAUTHLIB_INSECURE_TRANSPORT=1)Transport-Aware Callbacks: Stdio mode starts a minimal HTTP server only for OAuth, ensuring callbacks work in all modes
Production: Use HTTPS & OAuth 2.1 and configure accordingly
Scope Minimization: Tools request only necessary permissions
Local File Access Control: Tools that read local files (e.g., attachments,
file://uploads) are restricted to the user's home directory by default. Override this with theALLOWED_FILE_DIRSenvironment variable:# Colon-separated list of directories (semicolon on Windows) from which local file reads are permitted export ALLOWED_FILE_DIRS="/home/user/documents:/data/shared"Regardless of the allowlist, access to sensitive paths (
.env,.ssh/,.aws/,/etc/shadow, credential files, etc.) is always blocked.
≡ License
MIT License - see LICENSE file for details.
Validations:
Available Tools
144 toolsadd_conditional_formattingB
Adds a conditional formatting rule to a range.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (str): A1-style range (optionally with sheet name). Required. condition_type (str): Sheets condition type (e.g., NUMBER_GREATER, TEXT_CONTAINS, DATE_BEFORE, CUSTOM_FORMULA). condition_values (Optional[Union[str, List[Union[str, int, float]]]]): Values for the condition; accepts a list or a JSON string representing a list. Depends on condition_type. background_color (Optional[str]): Hex background color to apply when condition matches. text_color (Optional[str]): Hex text color to apply when condition matches. rule_index (Optional[int]): Optional position to insert the rule (0-based) within the sheet's rules. gradient_points (Optional[Union[str, List[dict]]]): List (or JSON list) of gradient points for a color scale. If provided, a gradient rule is created and boolean parameters are ignored.
Returns: str: Confirmation of the added rule.
Inputs: range_name (required), condition_type (required), spreadsheet_id (required), user_google_email (required), +5 more. Returns: result
batch_create_contactsC
Create multiple contacts in a batch operation.
Args: user_google_email (str): The user's Google email address. Required. contacts (List[Dict[str, str]]): List of contact dictionaries with fields: - given_name: First name - family_name: Last name - email: Email address - phone: Phone number - organization: Company name - job_title: Job title
Returns: str: Confirmation with created contacts.
Inputs: contacts (required), user_google_email (required). Returns: result
batch_delete_contactsC
Delete multiple contacts in a batch operation.
Args: user_google_email (str): The user's Google email address. Required. contact_ids (List[str]): List of contact IDs to delete.
Returns: str: Confirmation message.
Inputs: contact_ids (required), user_google_email (required). Returns: result
batch_modify_gmail_message_labelsA
Adds or removes labels from multiple Gmail messages in a single batch request.
Args: user_google_email (str): The user's Google email address. Required. message_ids (List[str]): A list of message IDs to modify. add_label_ids (Optional[List[str]]): List of label IDs to add to the messages. remove_label_ids (Optional[List[str]]): List of label IDs to remove from the messages.
Returns: str: Confirmation message of the label changes applied to the messages.
Inputs: message_ids (required), user_google_email (required), add_label_ids, remove_label_ids. Returns: result
batch_update_contactsC
Update multiple contacts in a batch operation.
Args: user_google_email (str): The user's Google email address. Required. updates (List[Dict[str, str]]): List of update dictionaries with fields: - contact_id: The contact ID to update (required) - given_name: New first name - family_name: New last name - email: New email address - phone: New phone number - organization: New company name - job_title: New job title
Returns: str: Confirmation with updated contacts.
Inputs: updates (required), user_google_email (required). Returns: result
batch_update_docA
Executes multiple document operations in a single atomic batch update.
Args: user_google_email: User's Google email address document_id: ID of the document to update operations: List of operation dictionaries. Each operation should contain: - type: Operation type ('insert_text', 'delete_text', 'replace_text', 'format_text', 'insert_table', 'insert_page_break') - Additional parameters specific to each operation type
Example operations: [ {"type": "insert_text", "index": 1, "text": "Hello World"}, {"type": "format_text", "start_index": 1, "end_index": 12, "bold": true}, {"type": "insert_table", "index": 20, "rows": 2, "columns": 3} ]
Returns: str: Confirmation message with batch operation results
Inputs: operations (required), document_id (required), user_google_email (required). Returns: result
batch_update_formA
Apply batch updates to a Google Form.
Supports adding, updating, and deleting form items, as well as updating form metadata and settings. This is the primary method for modifying form content after creation.
Args: user_google_email (str): The user's Google email address. Required. form_id (str): The ID of the form to update. requests (List[Dict[str, Any]]): List of update requests to apply. Supported request types: - createItem: Add a new question or content item - updateItem: Modify an existing item - deleteItem: Remove an item - moveItem: Reorder an item - updateFormInfo: Update form title/description - updateSettings: Modify form settings (e.g., quiz mode)
Returns: str: Details about the batch update operation results.
Inputs: form_id (required), requests (required), user_google_email (required). Returns: result
batch_update_presentationC
Apply batch updates to a Google Slides presentation.
Args: user_google_email (str): The user's Google email address. Required. presentation_id (str): The ID of the presentation to update. requests (List[Dict[str, Any]]): List of update requests to apply.
Returns: str: Details about the batch update operation results.
Inputs: requests (required), presentation_id (required), user_google_email (required). Returns: result
check_drive_file_public_accessA
Searches for a file by name and checks if it has public link sharing enabled.
Args: user_google_email (str): The user's Google email address. Required. file_name (str): The name of the file to check.
Returns: str: Information about the file's sharing status and whether it can be used in Google Docs.
Inputs: file_name (required), user_google_email (required). Returns: result
clear_completed_tasksB
Clear all completed tasks from a task list. The tasks will be marked as hidden.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to clear completed tasks from.
Returns: str: Confirmation message.
Inputs: task_list_id (required), user_google_email (required). Returns: result
copy_drive_fileA
Creates a copy of an existing Google Drive file.
This tool copies the template document to a new location with an optional new name. The copy maintains all formatting and content from the original file.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file to copy. Required. new_name (Optional[str]): New name for the copied file. If not provided, uses "Copy of [original name]". parent_folder_id (str): The ID of the folder where the copy should be created. Defaults to 'root' (My Drive).
Returns: str: Confirmation message with details of the copied file and its link.
Inputs: file_id (required), user_google_email (required), new_name, parent_folder_id. Returns: result
create_calendarC
Creates a new secondary Google Calendar.
Args: user_google_email (str): The user's Google email address. Required. summary (str): The name/title of the new calendar. description (Optional[str]): A description for the calendar. timezone (Optional[str]): IANA timezone for the calendar (e.g., "America/New_York"). Defaults to the user's primary calendar timezone.
Returns: str: Confirmation message with the new calendar's ID and name.
Inputs: summary (required), user_google_email (required), timezone, description. Returns: result
create_contactC
Create a new contact.
Args: user_google_email (str): The user's Google email address. Required. given_name (Optional[str]): First name. family_name (Optional[str]): Last name. email (Optional[str]): Email address. phone (Optional[str]): Phone number. organization (Optional[str]): Company/organization name. job_title (Optional[str]): Job title. notes (Optional[str]): Additional notes.
Returns: str: Confirmation with the new contact's details.
Inputs: user_google_email (required), email, notes, phone, +4 more. Returns: result
create_contact_groupC
Create a new contact group (label).
Args: user_google_email (str): The user's Google email address. Required. name (str): The name of the new contact group.
Returns: str: Confirmation with the new group details.
Inputs: name (required), user_google_email (required). Returns: result
create_deploymentC
Creates a new deployment of the script.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID description: Deployment description version_description: Optional version description
Returns: str: Formatted string with deployment details
Inputs: script_id (required), description (required), user_google_email (required), version_description. Returns: result
create_docB
Creates a new Google Doc and optionally inserts initial content.
Returns: str: Confirmation message with document ID and link.
Inputs: title (required), user_google_email (required), content. Returns: result
create_document_commentC
Create a new comment on a Google Document.
Inputs: document_id (required), comment_content (required), user_google_email (required). Returns: result
create_drive_fileA
Creates a new file in Google Drive, supporting creation within shared drives. Accepts either direct content or a fileUrl to fetch the content from.
Args: user_google_email (str): The user's Google email address. Required. file_name (str): The name for the new file. content (Optional[str]): If provided, the content to write to the file. folder_id (str): The ID of the parent folder. Defaults to 'root'. For shared drives, this must be a folder ID within the shared drive. mime_type (str): The MIME type of the file. Defaults to 'text/plain'. fileUrl (Optional[str]): If provided, fetches the file content from this URL. Supports file://, http://, and https:// protocols.
Returns: str: Confirmation message of the successful file creation with file link.
Inputs: file_name (required), user_google_email (required), content, fileUrl, +2 more. Returns: result
create_drive_folderA
Creates a new folder in Google Drive, supporting creation within shared drives.
Args: user_google_email (str): The user's Google email address. Required. folder_name (str): The name for the new folder. parent_folder_id (str): The ID of the parent folder. Defaults to 'root'. For shared drives, use a folder ID within that shared drive.
Returns: str: Confirmation message with folder name, ID, and link.
Inputs: folder_name (required), user_google_email (required), parent_folder_id. Returns: result
create_eventB
Creates a new event.
Args: user_google_email (str): The user's Google email address. Required. summary (str): Event title. start_time (str): Start time (RFC3339, e.g., "2023-10-27T10:00:00-07:00" or "2023-10-27" for all-day). end_time (str): End time (RFC3339, e.g., "2023-10-27T11:00:00-07:00" or "2023-10-28" for all-day). calendar_id (str): Calendar ID (default: 'primary'). description (Optional[str]): Event description. location (Optional[str]): Event location. attendees (Optional[List[str]]): Attendee email addresses. timezone (Optional[str]): Timezone (e.g., "America/New_York"). attachments (Optional[List[str]]): List of Google Drive file URLs or IDs to attach to the event. add_google_meet (bool): Whether to add a Google Meet video conference to the event. Defaults to False. reminders (Optional[Union[str, List[Dict[str, Any]]]]): JSON string or list of reminder objects. Each should have 'method' ("popup" or "email") and 'minutes' (0-40320). Max 5 reminders. Example: '[{"method": "popup", "minutes": 15}]' or [{"method": "popup", "minutes": 15}] use_default_reminders (bool): Whether to use calendar's default reminders. If False, uses custom reminders. Defaults to True. transparency (Optional[str]): Event transparency for busy/free status. "opaque" shows as Busy (default), "transparent" shows as Available/Free. Defaults to None (uses Google Calendar default). visibility (Optional[str]): Event visibility. "default" uses calendar default, "public" is visible to all, "private" is visible only to attendees, "confidential" is same as private (legacy). Defaults to None (uses Google Calendar default). guests_can_modify (Optional[bool]): Whether attendees other than the organizer can modify the event. Defaults to None (uses Google Calendar default of False). guests_can_invite_others (Optional[bool]): Whether attendees other than the organizer can invite others to the event. Defaults to None (uses Google Calendar default of True). guests_can_see_other_guests (Optional[bool]): Whether attendees other than the organizer can see who the event's attendees are. Defaults to None (uses Google Calendar default of True).
Returns: str: Confirmation message of the successful event creation with event link.
Inputs: summary (required), end_time (required), start_time (required), user_google_email (required), +14 more. Returns: result
create_formB
Create a new form using the title given in the provided form message in the request.
Args: user_google_email (str): The user's Google email address. Required. title (str): The title of the form. description (Optional[str]): The description of the form. document_title (Optional[str]): The document title (shown in browser tab).
Returns: str: Confirmation message with form ID and edit URL.
Inputs: title (required), user_google_email (required), description, document_title. Returns: result
create_gmail_filterC
Creates a Gmail filter using the users.settings.filters API.
Args: user_google_email (str): The user's Google email address. Required. criteria (Dict[str, Any]): Criteria for matching messages. action (Dict[str, Any]): Actions to apply to matched messages.
Returns: str: Confirmation message with the created filter ID.
Inputs: action (required), criteria (required), user_google_email (required). Returns: result
create_presentationA
Create a new Google Slides presentation.
Args: user_google_email (str): The user's Google email address. Required. title (str): The title for the new presentation. Defaults to "Untitled Presentation".
Returns: str: Details about the created presentation including ID and URL.
Inputs: user_google_email (required), title. Returns: result
create_presentation_commentC
Create a new comment on a Google Presentation.
Inputs: comment_content (required), presentation_id (required), user_google_email (required). Returns: result
create_reactionB
Adds an emoji reaction to a Google Chat message.
Args: message_id: The message resource name (e.g. spaces/X/messages/Y). emoji_unicode: The emoji character to react with (e.g. 👍).
Returns: str: Confirmation message.
Inputs: message_id (required), emoji_unicode (required), user_google_email (required). Returns: result
create_script_projectA
Creates a new Apps Script project.
Args: service: Injected Google API service client user_google_email: User's email address title: Project title parent_id: Optional Drive folder ID or bound container ID
Returns: str: Formatted string with new project details
Inputs: title (required), user_google_email (required), parent_id. Returns: result
create_sheetA
Creates a new sheet within an existing spreadsheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. sheet_name (str): The name of the new sheet. Required.
Returns: str: Confirmation message of the successful sheet creation.
Inputs: sheet_name (required), spreadsheet_id (required), user_google_email (required). Returns: result
create_spreadsheetA
Creates a new Google Spreadsheet.
Args: user_google_email (str): The user's Google email address. Required. title (str): The title of the new spreadsheet. Required. sheet_names (Optional[List[str]]): List of sheet names to create. If not provided, creates one sheet with default name.
Returns: str: Information about the newly created spreadsheet including ID, URL, and locale.
Inputs: title (required), user_google_email (required), sheet_names. Returns: result
create_spreadsheet_commentC
Create a new comment on a Google Spreadsheet.
Inputs: spreadsheet_id (required), comment_content (required), user_google_email (required). Returns: result
create_table_with_dataA
Creates a table and populates it with data in one reliable operation.
CRITICAL: YOU MUST CALL inspect_doc_structure FIRST TO GET THE INDEX!
MANDATORY WORKFLOW - DO THESE STEPS IN ORDER:
Step 1: ALWAYS call inspect_doc_structure first Step 2: Use the 'total_length' value from inspect_doc_structure as your index Step 3: Format data as 2D list: [["col1", "col2"], ["row1col1", "row1col2"]] Step 4: Call this function with the correct index and data
EXAMPLE DATA FORMAT: table_data = [ ["Header1", "Header2", "Header3"], # Row 0 - headers ["Data1", "Data2", "Data3"], # Row 1 - first data row ["Data4", "Data5", "Data6"] # Row 2 - second data row ]
CRITICAL INDEX REQUIREMENTS:
NEVER use index values like 1, 2, 10 without calling inspect_doc_structure first
ALWAYS get index from inspect_doc_structure 'total_length' field
Index must be a valid insertion point in the document
DATA FORMAT REQUIREMENTS:
Must be 2D list of strings only
Each inner list = one table row
All rows MUST have same number of columns
Use empty strings "" for empty cells, never None
Use debug_table_structure after creation to verify results
Args: user_google_email: User's Google email address document_id: ID of the document to update table_data: 2D list of strings - EXACT format: [["col1", "col2"], ["row1col1", "row1col2"]] index: Document position (MANDATORY: get from inspect_doc_structure 'total_length') bold_headers: Whether to make first row bold (default: true)
Returns: str: Confirmation with table details and link
Inputs: index (required), table_data (required), document_id (required), user_google_email (required), +1 more. Returns: result
create_taskA
Create a new task in a task list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to create the task in. title (str): The title of the task. notes (Optional[str]): Notes/description for the task. due (Optional[str]): Due date in RFC 3339 format (e.g., "2024-12-31T23:59:59Z"). parent (Optional[str]): Parent task ID (for subtasks). previous (Optional[str]): Previous sibling task ID (for positioning).
Returns: str: Confirmation message with the new task ID and details.
Inputs: title (required), task_list_id (required), user_google_email (required), due, +3 more. Returns: result
create_task_listC
Create a new task list.
Args: user_google_email (str): The user's Google email address. Required. title (str): The title of the new task list.
Returns: str: Confirmation message with the new task list ID and details.
Inputs: title (required), user_google_email (required). Returns: result
create_versionA
Creates a new immutable version of a script project.
Versions capture a snapshot of the current script code. Once created, versions cannot be modified.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID description: Optional description for this version
Returns: str: Formatted string with new version details
Inputs: script_id (required), user_google_email (required), description. Returns: result
debug_table_structureA
ESSENTIAL DEBUGGING TOOL - Use this whenever tables don't work as expected.
USE THIS IMMEDIATELY WHEN:
Table population put data in wrong cells
You get "table not found" errors
Data appears concatenated in first cell
Need to understand existing table structure
Planning to use populate_existing_table
WHAT THIS SHOWS YOU:
Exact table dimensions (rows × columns)
Each cell's position coordinates (row,col)
Current content in each cell
Insertion indices for each cell
Table boundaries and ranges
HOW TO READ THE OUTPUT:
"dimensions": "2x3" = 2 rows, 3 columns
"position": "(0,0)" = first row, first column
"current_content": What's actually in each cell right now
"insertion_index": Where new text would be inserted in that cell
WORKFLOW INTEGRATION:
After creating table → Use this to verify structure
Before populating → Use this to plan your data format
After population fails → Use this to see what went wrong
When debugging → Compare your data array to actual table structure
Args: user_google_email: User's Google email address document_id: ID of the document to inspect table_index: Which table to debug (0 = first table, 1 = second table, etc.)
Returns: str: Detailed JSON structure showing table layout, cell positions, and current content
Inputs: document_id (required), user_google_email (required), table_index. Returns: result
delete_conditional_formattingB
Deletes an existing conditional formatting rule by index on a sheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. rule_index (int): Index of the rule to delete (0-based). sheet_name (Optional[str]): Name of the sheet that contains the rule. Defaults to the first sheet if not provided.
Returns: str: Confirmation of the deletion and the current rule state.
Inputs: rule_index (required), spreadsheet_id (required), user_google_email (required), sheet_name. Returns: result
delete_contactC
Delete a contact.
Args: user_google_email (str): The user's Google email address. Required. contact_id (str): The contact ID to delete.
Returns: str: Confirmation message.
Inputs: contact_id (required), user_google_email (required). Returns: result
delete_contact_groupC
Delete a contact group.
Args: user_google_email (str): The user's Google email address. Required. group_id (str): The contact group ID to delete. delete_contacts (bool): If True, also delete contacts in the group (default: False).
Returns: str: Confirmation message.
Inputs: group_id (required), user_google_email (required), delete_contacts. Returns: result
delete_deploymentC
Deletes a deployment.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID deployment_id: The deployment ID to delete
Returns: str: Confirmation message
Inputs: script_id (required), deployment_id (required), user_google_email (required). Returns: result
delete_eventC
Deletes an existing event.
Args: user_google_email (str): The user's Google email address. Required. event_id (str): The ID of the event to delete. calendar_id (str): Calendar ID (default: 'primary').
Returns: str: Confirmation message of the successful event deletion.
Inputs: event_id (required), user_google_email (required), calendar_id. Returns: result
delete_gmail_filterC
Deletes a Gmail filter by ID.
Args: user_google_email (str): The user's Google email address. Required. filter_id (str): The ID of the filter to delete.
Returns: str: Confirmation message for the deletion.
Inputs: filter_id (required), user_google_email (required). Returns: result
delete_script_projectA
Deletes an Apps Script project.
This permanently deletes the script project. The action cannot be undone.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID to delete
Returns: str: Confirmation message
Inputs: script_id (required), user_google_email (required). Returns: result
delete_taskC
Delete a task from a task list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list containing the task. task_id (str): The ID of the task to delete.
Returns: str: Confirmation message.
Inputs: task_id (required), task_list_id (required), user_google_email (required). Returns: result
delete_task_listB
Delete a task list. Note: This will also delete all tasks in the list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to delete.
Returns: str: Confirmation message.
Inputs: task_list_id (required), user_google_email (required). Returns: result
download_chat_attachmentA
Downloads an attachment from a Google Chat message and saves it to local disk.
In stdio mode, returns the local file path for direct access. In HTTP mode, returns a temporary download URL (valid for 1 hour).
Args: message_id: The message resource name (e.g. spaces/X/messages/Y). attachment_index: Zero-based index of the attachment to download (default 0).
Returns: str: Attachment metadata with either a local file path or download URL.
Inputs: message_id (required), user_google_email (required), attachment_index. Returns: result
draft_gmail_messageA
Creates a draft email in the user's Gmail account. Supports both new drafts and reply drafts with optional attachments. Supports Gmail's "Send As" feature to draft from configured alias addresses.
Args: user_google_email (str): The user's Google email address. Required for authentication. subject (str): Email subject. body (str): Email body (plain text). body_format (Literal['plain', 'html']): Email body format. Defaults to 'plain'. to (Optional[str]): Optional recipient email address. Can be left empty for drafts. cc (Optional[str]): Optional CC email address. bcc (Optional[str]): Optional BCC email address. from_name (Optional[str]): Optional sender display name. If provided, the From header will be formatted as 'Name '. from_email (Optional[str]): Optional 'Send As' alias email address. The alias must be configured in Gmail settings (Settings > Accounts > Send mail as). If not provided, the draft will be from the authenticated user's primary email address. thread_id (Optional[str]): Optional Gmail thread ID to reply within. When provided, creates a reply draft. in_reply_to (Optional[str]): Optional Message-ID of the message being replied to. Used for proper threading. references (Optional[str]): Optional chain of Message-IDs for proper threading. Should include all previous Message-IDs. attachments (List[Dict[str, str]]): Optional list of attachments. Each dict can contain: Option 1 - File path (auto-encodes): - 'path' (required): File path to attach - 'filename' (optional): Override filename - 'mime_type' (optional): Override MIME type (auto-detected if not provided) Option 2 - Base64 content: - 'content' (required): Standard base64-encoded file content (not urlsafe) - 'filename' (required): Name of the file - 'mime_type' (optional): MIME type (defaults to 'application/octet-stream')
Returns: str: Confirmation message with the created draft's ID.
Examples: # Create a new draft draft_gmail_message(subject="Hello", body="Hi there!", to="user@example.com")
# Create a draft from a configured alias (Send As)
draft_gmail_message(
subject="Business Inquiry",
body="Hello from my business address...",
to="user@example.com",
from_email="business@mydomain.com"
)
# Create a plaintext draft with CC and BCC
draft_gmail_message(
subject="Project Update",
body="Here's the latest update...",
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com"
)
# Create a HTML draft with CC and BCC
draft_gmail_message(
subject="Project Update",
body="<strong>Hi there!</strong>",
body_format="html",
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com"
)
# Create a reply draft in plaintext
draft_gmail_message(
subject="Re: Meeting tomorrow",
body="Thanks for the update!",
to="user@example.com",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)
# Create a reply draft in HTML
draft_gmail_message(
subject="Re: Meeting tomorrow",
body="<strong>Thanks for the update!</strong>",
body_format="html",
to="user@example.com",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)Inputs: body (required), subject (required), user_google_email (required), cc, +9 more. Returns: result
export_doc_to_pdfA
Exports a Google Doc to PDF format and saves it to Google Drive.
Args: user_google_email: User's Google email address document_id: ID of the Google Doc to export pdf_filename: Name for the PDF file (optional - if not provided, uses original name + "_PDF") folder_id: Drive folder ID to save PDF in (optional - if not provided, saves in root)
Returns: str: Confirmation message with PDF file details and links
Inputs: document_id (required), user_google_email (required), folder_id, pdf_filename. Returns: result
find_and_replace_docA
Finds and replaces text throughout a Google Doc.
Args: user_google_email: User's Google email address document_id: ID of the document to update find_text: Text to search for replace_text: Text to replace with match_case: Whether to match case exactly
Returns: str: Confirmation message with replacement count
Inputs: find_text (required), document_id (required), replace_text (required), user_google_email (required), +1 more. Returns: result
format_sheet_rangeA
Applies formatting to a range: colors, number formats, text wrapping, alignment, and text styling.
Colors accept hex strings (#RRGGBB). Number formats follow Sheets types (e.g., NUMBER, CURRENCY, DATE, PERCENT). If no sheet name is provided, the first sheet is used.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (str): A1-style range (optionally with sheet name). Required. background_color (Optional[str]): Hex background color (e.g., "#FFEECC"). text_color (Optional[str]): Hex text color (e.g., "#000000"). number_format_type (Optional[str]): Sheets number format type (e.g., "DATE"). number_format_pattern (Optional[str]): Custom pattern for the number format. wrap_strategy (Optional[str]): Text wrap strategy - WRAP (wrap text within cell), CLIP (clip text at cell boundary), or OVERFLOW_CELL (allow text to overflow into adjacent empty cells). horizontal_alignment (Optional[str]): Horizontal text alignment - LEFT, CENTER, or RIGHT. vertical_alignment (Optional[str]): Vertical text alignment - TOP, MIDDLE, or BOTTOM. bold (Optional[bool]): Whether to apply bold formatting. italic (Optional[bool]): Whether to apply italic formatting. font_size (Optional[int]): Font size in points.
Returns: str: Confirmation of the applied formatting.
Inputs: range_name (required), spreadsheet_id (required), user_google_email (required), bold, +9 more. Returns: result
generate_trigger_codeA
Generates Apps Script code for creating triggers.
The Apps Script API cannot create triggers directly - they must be created from within Apps Script itself. This tool generates the code you need.
Args: trigger_type: Type of trigger. One of: - "time_minutes" (run every N minutes: 1, 5, 10, 15, 30) - "time_hours" (run every N hours: 1, 2, 4, 6, 8, 12) - "time_daily" (run daily at a specific hour: 0-23) - "time_weekly" (run weekly on a specific day) - "on_open" (simple trigger - runs when document opens) - "on_edit" (simple trigger - runs when user edits) - "on_form_submit" (runs when form is submitted) - "on_change" (runs when content changes)
function_name: The function to run when trigger fires (e.g., "sendDailyReport")
schedule: Schedule details (depends on trigger_type):
- For time_minutes: "1", "5", "10", "15", or "30"
- For time_hours: "1", "2", "4", "6", "8", or "12"
- For time_daily: hour as "0"-"23" (e.g., "9" for 9am)
- For time_weekly: "MONDAY", "TUESDAY", etc.
- For simple triggers (on_open, on_edit): not neededReturns: str: Apps Script code to create the trigger
Inputs: trigger_type (required), function_name (required), schedule. Returns: result
get_contactB
Get detailed information about a specific contact.
Args: user_google_email (str): The user's Google email address. Required. contact_id (str): The contact ID (e.g., "c1234567890" or full resource name "people/c1234567890").
Returns: str: Detailed contact information.
Inputs: contact_id (required), user_google_email (required). Returns: result
get_contact_groupA
Get details of a specific contact group including its members.
Args: user_google_email (str): The user's Google email address. Required. group_id (str): The contact group ID. max_members (int): Maximum number of members to return (default: 100, max: 1000).
Returns: str: Contact group details including members.
Inputs: group_id (required), user_google_email (required), max_members. Returns: result
get_doc_as_markdownA
Reads a Google Doc and returns it as clean Markdown with optional comment context.
Unlike get_doc_content which returns plain text, this tool preserves document formatting as Markdown: headings, bold/italic/strikethrough, links, code spans, ordered/unordered lists with nesting, and tables.
When comments are included (the default), each comment's anchor text — the specific text the comment was attached to — is preserved, giving full context for the discussion.
Args: user_google_email: User's Google email address document_id: ID of the Google Doc (or full URL) include_comments: Whether to include comments (default: True) comment_mode: How to display comments: - "inline": Footnote-style references placed at the anchor text location (default) - "appendix": All comments grouped at the bottom with blockquoted anchor text - "none": No comments included include_resolved: Whether to include resolved comments (default: False)
Returns: str: The document content as Markdown, optionally with comments
Inputs: document_id (required), user_google_email (required), comment_mode, include_comments, +1 more. Returns: result
get_doc_contentA
Retrieves content of a Google Doc or a Drive file (like .docx) identified by document_id.
Native Google Docs: Fetches content via Docs API.
Office files (.docx, etc.) stored in Drive: Downloads via Drive API and extracts text.
Returns: str: The document content with metadata header.
Inputs: document_id (required), user_google_email (required). Returns: result
get_drive_file_contentA
Retrieves the content of a specific Google Drive file by ID, supporting files in shared drives.
• Native Google Docs, Sheets, Slides → exported as text / CSV. • Office files (.docx, .xlsx, .pptx) → unzipped & parsed with std-lib to extract readable text. • Any other file → downloaded; tries UTF-8 decode, else notes binary.
Args: user_google_email: The user’s Google email address. file_id: Drive file ID.
Returns: str: The file content as plain text with metadata header.
Inputs: file_id (required), user_google_email (required). Returns: result
get_drive_file_download_urlA
Downloads a Google Drive file and saves it to local disk.
In stdio mode, returns the local file path for direct access. In HTTP mode, returns a temporary download URL (valid for 1 hour).
For Google native files (Docs, Sheets, Slides), exports to a useful format:
Google Docs -> PDF (default) or DOCX if export_format='docx'
Google Sheets -> XLSX (default), PDF if export_format='pdf', or CSV if export_format='csv'
Google Slides -> PDF (default) or PPTX if export_format='pptx'
For other files, downloads the original file format.
Args: user_google_email: The user's Google email address. Required. file_id: The Google Drive file ID to download. export_format: Optional export format for Google native files. Options: 'pdf', 'docx', 'xlsx', 'csv', 'pptx'. If not specified, uses sensible defaults (PDF for Docs/Slides, XLSX for Sheets). For Sheets: supports 'csv', 'pdf', or 'xlsx' (default).
Returns: str: File metadata with either a local file path or download URL.
Inputs: file_id (required), user_google_email (required), export_format. Returns: result
get_drive_file_permissionsB
Gets detailed metadata about a Google Drive file including sharing permissions.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file to check permissions for.
Returns: str: Detailed file metadata including sharing status and URLs.
Inputs: file_id (required), user_google_email (required). Returns: result
get_eventsA
Retrieves events from a specified Google Calendar. Can retrieve a single event by ID or multiple events within a time range. You can also search for events by keyword by supplying the optional "query" param.
Args:
user_google_email (str): The user's Google email address. Required.
calendar_id (str): The ID of the calendar to query. Use 'primary' for the user's primary calendar. Defaults to 'primary'. Calendar IDs can be obtained using list_calendars.
event_id (Optional[str]): The ID of a specific event to retrieve. If provided, retrieves only this event and ignores time filtering parameters.
time_min (Optional[str]): The start of the time range (inclusive) in RFC3339 format (e.g., '2024-05-12T10:00:00Z' or '2024-05-12'). If omitted, defaults to the current time. Ignored if event_id is provided.
time_max (Optional[str]): The end of the time range (exclusive) in RFC3339 format. If omitted, events starting from time_min onwards are considered (up to max_results). Ignored if event_id is provided.
max_results (int): The maximum number of events to return. Defaults to 25. Ignored if event_id is provided.
query (Optional[str]): A keyword to search for within event fields (summary, description, location). Ignored if event_id is provided.
detailed (bool): Whether to return detailed event information including description, location, attendees, and attendee details (response status, organizer, optional flags). Defaults to False.
include_attachments (bool): Whether to include attachment information in detailed event output. When True, shows attachment details (fileId, fileUrl, mimeType, title) for events that have attachments. Only applies when detailed=True. Set this to True when you need to view or access files that have been attached to calendar events, such as meeting documents, presentations, or other shared files. Defaults to False.
Returns: str: A formatted list of events (summary, start and end times, link) within the specified range, or detailed information for a single event if event_id is provided.
Inputs: user_google_email (required), query, detailed, event_id, +5 more. Returns: result
get_formA
Get a form.
Args: user_google_email (str): The user's Google email address. Required. form_id (str): The ID of the form to retrieve.
Returns: str: Form details including title, description, questions, and URLs.
Inputs: form_id (required), user_google_email (required). Returns: result
get_form_responseA
Get one response from the form.
Args: user_google_email (str): The user's Google email address. Required. form_id (str): The ID of the form. response_id (str): The ID of the response to retrieve.
Returns: str: Response details including answers and metadata.
Inputs: form_id (required), response_id (required), user_google_email (required). Returns: result
get_gmail_attachment_contentA
Downloads an email attachment and saves it to local disk.
In stdio mode, returns the local file path for direct access. In HTTP mode, returns a temporary download URL (valid for 1 hour). May re-fetch message metadata to resolve filename and MIME type.
Args: message_id (str): The ID of the Gmail message containing the attachment. attachment_id (str): The ID of the attachment to download. user_google_email (str): The user's Google email address. Required.
Returns: str: Attachment metadata with either a local file path or download URL.
Inputs: message_id (required), attachment_id (required), user_google_email (required). Returns: result
get_gmail_message_contentA
Retrieves the full content (subject, sender, recipients, plain text body) of a specific Gmail message.
Args: message_id (str): The unique ID of the Gmail message to retrieve. user_google_email (str): The user's Google email address. Required.
Returns: str: The message details including subject, sender, date, Message-ID, recipients (To, Cc), and body content.
Inputs: message_id (required), user_google_email (required). Returns: result
get_gmail_messages_content_batchA
Retrieves the content of multiple Gmail messages in a single batch request. Supports up to 25 messages per batch to prevent SSL connection exhaustion.
Args: message_ids (List[str]): List of Gmail message IDs to retrieve (max 25 per batch). user_google_email (str): The user's Google email address. Required. format (Literal["full", "metadata"]): Message format. "full" includes body, "metadata" only headers.
Returns: str: A formatted list of message contents including subject, sender, date, Message-ID, recipients (To, Cc), and body (if full format).
Inputs: message_ids (required), user_google_email (required), format. Returns: result
get_gmail_thread_contentA
Retrieves the complete content of a Gmail conversation thread, including all messages.
Args: thread_id (str): The unique ID of the Gmail thread to retrieve. user_google_email (str): The user's Google email address. Required.
Returns: str: The complete thread content with all messages formatted for reading.
Inputs: thread_id (required), user_google_email (required). Returns: result
get_gmail_threads_content_batchA
Retrieves the content of multiple Gmail threads in a single batch request. Supports up to 25 threads per batch to prevent SSL connection exhaustion.
Args: thread_ids (List[str]): A list of Gmail thread IDs to retrieve. The function will automatically batch requests in chunks of 25. user_google_email (str): The user's Google email address. Required.
Returns: str: A formatted list of thread contents with separators.
Inputs: thread_ids (required), user_google_email (required). Returns: result
get_messagesC
Retrieves messages from a Google Chat space.
Returns: str: Formatted messages from the specified space.
Inputs: space_id (required), user_google_email (required), order_by, page_size. Returns: result
get_pageA
Get details about a specific page (slide) in a presentation.
Args: user_google_email (str): The user's Google email address. Required. presentation_id (str): The ID of the presentation. page_object_id (str): The object ID of the page/slide to retrieve.
Returns: str: Details about the specific page including elements and layout.
Inputs: page_object_id (required), presentation_id (required), user_google_email (required). Returns: result
get_page_thumbnailA
Generate a thumbnail URL for a specific page (slide) in a presentation.
Args: user_google_email (str): The user's Google email address. Required. presentation_id (str): The ID of the presentation. page_object_id (str): The object ID of the page/slide. thumbnail_size (str): Size of thumbnail ("LARGE", "MEDIUM", "SMALL"). Defaults to "MEDIUM".
Returns: str: URL to the generated thumbnail image.
Inputs: page_object_id (required), presentation_id (required), user_google_email (required), thumbnail_size. Returns: result
get_presentationA
Get details about a Google Slides presentation.
Args: user_google_email (str): The user's Google email address. Required. presentation_id (str): The ID of the presentation to retrieve.
Returns: str: Details about the presentation including title, slides count, and metadata.
Inputs: presentation_id (required), user_google_email (required). Returns: result
get_script_contentA
Retrieves content of a specific file within a project.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID file_name: Name of the file to retrieve
Returns: str: File content as string
Inputs: file_name (required), script_id (required), user_google_email (required). Returns: result
get_script_metricsA
Gets execution metrics for a script project.
Returns analytics data including active users, total executions, and failed executions over time.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID metrics_granularity: Granularity of metrics - "DAILY" or "WEEKLY"
Returns: str: Formatted string with metrics data
Inputs: script_id (required), user_google_email (required), metrics_granularity. Returns: result
get_script_projectB
Retrieves complete project details including all source files.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID
Returns: str: Formatted project details with all file contents
Inputs: script_id (required), user_google_email (required). Returns: result
get_search_engine_infoA
Retrieves metadata about a Programmable Search Engine.
Args: user_google_email (str): The user's Google email address. Required.
Returns: str: Information about the search engine including its configuration and available refinements.
Inputs: user_google_email (required). Returns: result
get_spreadsheet_infoA
Gets information about a specific spreadsheet including its sheets.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet to get info for. Required.
Returns: str: Formatted spreadsheet information including title, locale, and sheets list.
Inputs: spreadsheet_id (required), user_google_email (required). Returns: result
get_taskA
Get details of a specific task.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list containing the task. task_id (str): The ID of the task to retrieve.
Returns: str: Task details including title, notes, status, due date, etc.
Inputs: task_id (required), task_list_id (required), user_google_email (required). Returns: result
get_task_listA
Get details of a specific task list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to retrieve.
Returns: str: Task list details including title, ID, and last updated time.
Inputs: task_list_id (required), user_google_email (required). Returns: result
get_versionA
Gets details of a specific version.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID version_number: The version number to retrieve (1, 2, 3, etc.)
Returns: str: Formatted string with version details
Inputs: script_id (required), version_number (required), user_google_email (required). Returns: result
import_to_google_docA
Imports a file (Markdown, DOCX, TXT, HTML, RTF, ODT) into Google Docs format with automatic conversion.
Google Drive automatically converts the source file to native Google Docs format, preserving formatting like headings, lists, bold, italic, etc.
Args: user_google_email (str): The user's Google email address. Required. file_name (str): The name for the new Google Doc (extension will be ignored). content (Optional[str]): Text content for text-based formats (MD, TXT, HTML). file_path (Optional[str]): Local file path for binary formats (DOCX, ODT). Supports file:// URLs. file_url (Optional[str]): Remote URL to fetch the file from (http/https). source_format (Optional[str]): Source format hint ('md', 'markdown', 'docx', 'txt', 'html', 'rtf', 'odt'). Auto-detected from file_name extension if not provided. folder_id (str): The ID of the parent folder. Defaults to 'root'.
Returns: str: Confirmation message with the new Google Doc link.
Examples: # Import markdown content directly import_to_google_doc(file_name="My Doc.md", content="# Title\n\nHello world")
# Import a local DOCX file
import_to_google_doc(file_name="Report", file_path="/path/to/report.docx")
# Import from URL
import_to_google_doc(file_name="Remote Doc", file_url="https://example.com/doc.md")Inputs: file_name (required), user_google_email (required), content, file_url, +3 more. Returns: result
insert_doc_elementsB
Inserts structural elements like tables, lists, or page breaks into a Google Doc.
Args: user_google_email: User's Google email address document_id: ID of the document to update element_type: Type of element to insert ("table", "list", "page_break") index: Position to insert element (0-based) rows: Number of rows for table (required for table) columns: Number of columns for table (required for table) list_type: Type of list ("UNORDERED", "ORDERED") (required for list) text: Initial text content for list items
Returns: str: Confirmation message with insertion details
Inputs: index (required), document_id (required), element_type (required), user_google_email (required), +4 more. Returns: result
insert_doc_imageB
Inserts an image into a Google Doc from Drive or a URL.
Args: user_google_email: User's Google email address document_id: ID of the document to update image_source: Drive file ID or public image URL index: Position to insert image (0-based) width: Image width in points (optional) height: Image height in points (optional)
Returns: str: Confirmation message with insertion details
Inputs: index (required), document_id (required), image_source (required), user_google_email (required), +2 more. Returns: result
inspect_doc_structureA
Essential tool for finding safe insertion points and understanding document structure.
USE THIS FOR:
Finding the correct index for table insertion
Understanding document layout before making changes
Locating existing tables and their positions
Getting document statistics and complexity info
CRITICAL FOR TABLE OPERATIONS: ALWAYS call this BEFORE creating tables to get a safe insertion index.
WHAT THE OUTPUT SHOWS:
total_elements: Number of document elements
total_length: Maximum safe index for insertion
tables: Number of existing tables
table_details: Position and dimensions of each table
WORKFLOW: Step 1: Call this function Step 2: Note the "total_length" value Step 3: Use an index < total_length for table insertion Step 4: Create your table
Args: user_google_email: User's Google email address document_id: ID of the document to inspect detailed: Whether to return detailed structure information
Returns: str: JSON string containing document structure and safe insertion indices
Inputs: document_id (required), user_google_email (required), detailed. Returns: result
list_calendarsA
Retrieves a list of calendars accessible to the authenticated user.
Args: user_google_email (str): The user's Google email address. Required.
Returns: str: A formatted list of the user's calendars (summary, ID, primary status).
Inputs: user_google_email (required). Returns: result
list_contact_groupsA
List contact groups (labels) for the user.
Args: user_google_email (str): The user's Google email address. Required. page_size (int): Maximum number of groups to return (default: 100, max: 1000). page_token (Optional[str]): Token for pagination.
Returns: str: List of contact groups with their details.
Inputs: user_google_email (required), page_size, page_token. Returns: result
list_contactsA
List contacts for the authenticated user.
Args: user_google_email (str): The user's Google email address. Required. page_size (int): Maximum number of contacts to return (default: 100, max: 1000). page_token (Optional[str]): Token for pagination. sort_order (Optional[str]): Sort order: "LAST_MODIFIED_ASCENDING", "LAST_MODIFIED_DESCENDING", "FIRST_NAME_ASCENDING", or "LAST_NAME_ASCENDING".
Returns: str: List of contacts with their basic information.
Inputs: user_google_email (required), page_size, page_token, sort_order. Returns: result
list_deploymentsA
Lists all deployments for a script project.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID
Returns: str: Formatted string with deployment list
Inputs: script_id (required), user_google_email (required). Returns: result
list_docs_in_folderC
Lists Google Docs within a specific Drive folder.
Returns: str: A formatted list of Google Docs in the specified folder.
Inputs: user_google_email (required), folder_id, page_size. Returns: result
list_drive_itemsA
Lists files and folders, supporting shared drives.
If drive_id is specified, lists items within that shared drive. folder_id is then relative to that drive (or use drive_id as folder_id for root).
If drive_id is not specified, lists items from user's "My Drive" and accessible shared drives (if include_items_from_all_drives is True).
Args:
user_google_email (str): The user's Google email address. Required.
folder_id (str): The ID of the Google Drive folder. Defaults to 'root'. For a shared drive, this can be the shared drive's ID to list its root, or a folder ID within that shared drive.
page_size (int): The maximum number of items to return. Defaults to 100.
drive_id (Optional[str]): ID of the shared drive. If provided, the listing is scoped to this drive.
include_items_from_all_drives (bool): Whether items from all accessible shared drives should be included if drive_id is not set. Defaults to True.
corpora (Optional[str]): Corpus to query ('user', 'drive', 'allDrives'). If drive_id is set and corpora is None, 'drive' is used. If None and no drive_id, API defaults apply.
detailed (bool): Whether to include size, modified time, and link in results. Defaults to True.
Returns: str: A formatted list of files/folders in the specified folder.
Inputs: user_google_email (required), corpora, detailed, drive_id, +3 more. Returns: result
list_form_responsesA
List a form's responses.
Args: user_google_email (str): The user's Google email address. Required. form_id (str): The ID of the form. page_size (int): Maximum number of responses to return. Defaults to 10. page_token (Optional[str]): Token for retrieving next page of results.
Returns: str: List of responses with basic details and pagination info.
Inputs: form_id (required), user_google_email (required), page_size, page_token. Returns: result
list_gmail_filtersA
Lists all Gmail filters configured in the user's mailbox.
Args: user_google_email (str): The user's Google email address. Required.
Returns: str: A formatted list of filters with their criteria and actions.
Inputs: user_google_email (required). Returns: result
list_gmail_labelsB
Lists all labels in the user's Gmail account.
Args: user_google_email (str): The user's Google email address. Required.
Returns: str: A formatted list of all labels with their IDs, names, and types.
Inputs: user_google_email (required). Returns: result
list_script_processesA
Lists recent execution processes for user's scripts.
Args: service: Injected Google API service client user_google_email: User's email address page_size: Number of results (default: 50) script_id: Optional filter by script ID
Returns: str: Formatted string with process list
Inputs: user_google_email (required), page_size, script_id. Returns: result
list_script_projectsA
Lists Google Apps Script projects accessible to the user.
Uses Drive API to find Apps Script files.
Args: service: Injected Google API service client user_google_email: User's email address page_size: Number of results per page (default: 50) page_token: Token for pagination (optional)
Returns: str: Formatted list of script projects
Inputs: user_google_email (required), page_size, page_token. Returns: result
list_spacesB
Lists Google Chat spaces (rooms and direct messages) accessible to the user.
Returns: str: A formatted list of Google Chat spaces accessible to the user.
Inputs: user_google_email (required), page_size, space_type. Returns: result
list_spreadsheetsA
Lists spreadsheets from Google Drive that the user has access to.
Args: user_google_email (str): The user's Google email address. Required. max_results (int): Maximum number of spreadsheets to return. Defaults to 25.
Returns: str: A formatted list of spreadsheet files (name, ID, modified time).
Inputs: user_google_email (required), max_results. Returns: result
list_task_listsA
List all task lists for the user.
Args: user_google_email (str): The user's Google email address. Required. max_results (int): Maximum number of task lists to return (default: 1000, max: 1000). page_token (Optional[str]): Token for pagination.
Returns: str: List of task lists with their IDs, titles, and details.
Inputs: user_google_email (required), page_token, max_results. Returns: result
list_tasksA
List all tasks in a specific task list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to retrieve tasks from. max_results (int): Maximum number of tasks to return. (default: 20, max: 10000). page_token (Optional[str]): Token for pagination. show_completed (bool): Whether to include completed tasks (default: True). Note that show_hidden must also be true to show tasks completed in first party clients, such as the web UI and Google's mobile apps. show_deleted (bool): Whether to include deleted tasks (default: False). show_hidden (bool): Whether to include hidden tasks (default: False). show_assigned (bool): Whether to include assigned tasks (default: False). completed_max (Optional[str]): Upper bound for completion date (RFC 3339 timestamp). completed_min (Optional[str]): Lower bound for completion date (RFC 3339 timestamp). due_max (Optional[str]): Upper bound for due date (RFC 3339 timestamp). due_min (Optional[str]): Lower bound for due date (RFC 3339 timestamp). updated_min (Optional[str]): Lower bound for last modification time (RFC 3339 timestamp).
Returns: str: List of tasks with their details.
Inputs: task_list_id (required), user_google_email (required), due_max, due_min, +9 more. Returns: result
list_versionsA
Lists all versions of a script project.
Versions are immutable snapshots of your script code. They are created when you deploy or explicitly create a version.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID
Returns: str: Formatted string with version list
Inputs: script_id (required), user_google_email (required). Returns: result
manage_gmail_labelA
Manages Gmail labels: create, update, or delete labels.
Args: user_google_email (str): The user's Google email address. Required. action (Literal["create", "update", "delete"]): Action to perform on the label. name (Optional[str]): Label name. Required for create, optional for update. label_id (Optional[str]): Label ID. Required for update and delete operations. label_list_visibility (Literal["labelShow", "labelHide"]): Whether the label is shown in the label list. message_list_visibility (Literal["show", "hide"]): Whether the label is shown in the message list.
Returns: str: Confirmation message of the label operation.
Inputs: action (required), user_google_email (required), name, label_id, +2 more. Returns: result
modify_contact_group_membersC
Add or remove contacts from a contact group.
Args: user_google_email (str): The user's Google email address. Required. group_id (str): The contact group ID. add_contact_ids (Optional[List[str]]): Contact IDs to add to the group. remove_contact_ids (Optional[List[str]]): Contact IDs to remove from the group.
Returns: str: Confirmation with results.
Inputs: group_id (required), user_google_email (required), add_contact_ids, remove_contact_ids. Returns: result
modify_doc_textA
Modifies text in a Google Doc - can insert/replace text and/or apply formatting in a single operation.
Args: user_google_email: User's Google email address document_id: ID of the document to update start_index: Start position for operation (0-based) end_index: End position for text replacement/formatting (if not provided with text, text is inserted) text: New text to insert or replace with (optional - can format existing text without changing it) bold: Whether to make text bold (True/False/None to leave unchanged) italic: Whether to make text italic (True/False/None to leave unchanged) underline: Whether to underline text (True/False/None to leave unchanged) font_size: Font size in points font_family: Font family name (e.g., "Arial", "Times New Roman") text_color: Foreground text color (#RRGGBB) background_color: Background/highlight color (#RRGGBB) link_url: Hyperlink URL (http/https)
Returns: str: Confirmation message with operation details
Inputs: document_id (required), start_index (required), user_google_email (required), bold, +9 more. Returns: result
modify_eventA
Modifies an existing event.
Args: user_google_email (str): The user's Google email address. Required. event_id (str): The ID of the event to modify. calendar_id (str): Calendar ID (default: 'primary'). summary (Optional[str]): New event title. start_time (Optional[str]): New start time (RFC3339, e.g., "2023-10-27T10:00:00-07:00" or "2023-10-27" for all-day). end_time (Optional[str]): New end time (RFC3339, e.g., "2023-10-27T11:00:00-07:00" or "2023-10-28" for all-day). description (Optional[str]): New event description. location (Optional[str]): New event location. attendees (Optional[Union[List[str], List[Dict[str, Any]]]]): Attendees as email strings or objects with metadata. Supports: ["email@example.com"] or [{"email": "email@example.com", "responseStatus": "accepted", "organizer": true, "optional": true}]. When using objects, existing metadata (responseStatus, organizer, optional) is preserved. New attendees default to responseStatus="needsAction". timezone (Optional[str]): New timezone (e.g., "America/New_York"). add_google_meet (Optional[bool]): Whether to add or remove Google Meet video conference. If True, adds Google Meet; if False, removes it; if None, leaves unchanged. reminders (Optional[Union[str, List[Dict[str, Any]]]]): JSON string or list of reminder objects to replace existing reminders. Each should have 'method' ("popup" or "email") and 'minutes' (0-40320). Max 5 reminders. Example: '[{"method": "popup", "minutes": 15}]' or [{"method": "popup", "minutes": 15}] use_default_reminders (Optional[bool]): Whether to use calendar's default reminders. If specified, overrides current reminder settings. transparency (Optional[str]): Event transparency for busy/free status. "opaque" shows as Busy, "transparent" shows as Available/Free. If None, preserves existing transparency setting. visibility (Optional[str]): Event visibility. "default" uses calendar default, "public" is visible to all, "private" is visible only to attendees, "confidential" is same as private (legacy). If None, preserves existing visibility setting. color_id (Optional[str]): Event color ID (1-11). If None, preserves existing color. guests_can_modify (Optional[bool]): Whether attendees other than the organizer can modify the event. If None, preserves existing setting. guests_can_invite_others (Optional[bool]): Whether attendees other than the organizer can invite others to the event. If None, preserves existing setting. guests_can_see_other_guests (Optional[bool]): Whether attendees other than the organizer can see who the event's attendees are. If None, preserves existing setting.
Returns: str: Confirmation message of the successful event modification with event link.
Inputs: event_id (required), user_google_email (required), summary, color_id, +15 more. Returns: result
modify_gmail_message_labelsA
Adds or removes labels from a Gmail message. To archive an email, remove the INBOX label. To delete an email, add the TRASH label.
Args: user_google_email (str): The user's Google email address. Required. message_id (str): The ID of the message to modify. add_label_ids (Optional[List[str]]): List of label IDs to add to the message. remove_label_ids (Optional[List[str]]): List of label IDs to remove from the message.
Returns: str: Confirmation message of the label changes applied to the message.
Inputs: message_id (required), user_google_email (required), add_label_ids, remove_label_ids. Returns: result
modify_sheet_valuesA
Modifies values in a specific range of a Google Sheet - can write, update, or clear values.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (str): The range to modify (e.g., "Sheet1!A1:D10", "A1:D10"). Required. values (Optional[Union[str, List[List[str]]]]): 2D array of values to write/update. Can be a JSON string or Python list. Required unless clear_values=True. value_input_option (str): How to interpret input values ("RAW" or "USER_ENTERED"). Defaults to "USER_ENTERED". clear_values (bool): If True, clears the range instead of writing values. Defaults to False.
Returns: str: Confirmation message of the successful modification operation.
Inputs: range_name (required), spreadsheet_id (required), user_google_email (required), values, +2 more. Returns: result
move_taskB
Move a task to a different position or parent within the same list, or to a different list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the current task list containing the task. task_id (str): The ID of the task to move. parent (Optional[str]): New parent task ID (for making it a subtask). previous (Optional[str]): Previous sibling task ID (for positioning). destination_task_list (Optional[str]): Destination task list ID (for moving between lists).
Returns: str: Confirmation message with updated task details.
Inputs: task_id (required), task_list_id (required), user_google_email (required), parent, +2 more. Returns: result
query_freebusyA
Returns free/busy information for a set of calendars.
Args:
user_google_email (str): The user's Google email address. Required.
time_min (str): The start of the interval for the query in RFC3339 format (e.g., '2024-05-12T10:00:00Z' or '2024-05-12').
time_max (str): The end of the interval for the query in RFC3339 format (e.g., '2024-05-12T18:00:00Z' or '2024-05-12').
calendar_ids (Optional[List[str]]): List of calendar identifiers to query. If not provided, queries the primary calendar. Use 'primary' for the user's primary calendar or specific calendar IDs obtained from list_calendars.
group_expansion_max (Optional[int]): Maximum number of calendar identifiers to be provided for a single group. Optional. An error is returned for a group with more members than this value. Maximum value is 100.
calendar_expansion_max (Optional[int]): Maximum number of calendars for which FreeBusy information is to be provided. Optional. Maximum value is 50.
Returns: str: A formatted response showing free/busy information for each requested calendar, including busy time periods.
Inputs: time_max (required), time_min (required), user_google_email (required), calendar_ids, +2 more. Returns: result
read_document_commentsB
Read all comments from a Google Document.
Inputs: document_id (required), user_google_email (required). Returns: result
read_presentation_commentsC
Read all comments from a Google Presentation.
Inputs: presentation_id (required), user_google_email (required). Returns: result
read_sheet_valuesA
Reads values from a specific range in a Google Sheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (str): The range to read (e.g., "Sheet1!A1:D10", "A1:D10"). Defaults to "A1:Z1000". include_hyperlinks (bool): If True, also fetch hyperlink metadata for the range. Defaults to False to avoid expensive includeGridData requests.
Returns: str: The formatted values from the specified range.
Inputs: spreadsheet_id (required), user_google_email (required), range_name, include_hyperlinks. Returns: result
read_spreadsheet_commentsC
Read all comments from a Google Spreadsheet.
Inputs: spreadsheet_id (required), user_google_email (required). Returns: result
remove_drive_permissionB
Removes a permission from a Google Drive file or folder, revoking access.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder. Required. permission_id (str): The ID of the permission to remove (from get_drive_file_permissions). Required.
Returns: str: Confirmation of the removed permission.
Inputs: file_id (required), permission_id (required), user_google_email (required). Returns: result
reply_to_document_commentC
Reply to a specific comment in a Google Document.
Inputs: comment_id (required), document_id (required), reply_content (required), user_google_email (required). Returns: result
reply_to_presentation_commentC
Reply to a specific comment in a Google Presentation.
Inputs: comment_id (required), reply_content (required), presentation_id (required), user_google_email (required). Returns: result
reply_to_spreadsheet_commentC
Reply to a specific comment in a Google Spreadsheet.
Inputs: comment_id (required), reply_content (required), spreadsheet_id (required), user_google_email (required). Returns: result
resolve_document_commentC
Resolve a comment in a Google Document.
Inputs: comment_id (required), document_id (required), user_google_email (required). Returns: result
resolve_presentation_commentC
Resolve a comment in a Google Presentation.
Inputs: comment_id (required), presentation_id (required), user_google_email (required). Returns: result
resolve_spreadsheet_commentC
Resolve a comment in a Google Spreadsheet.
Inputs: comment_id (required), spreadsheet_id (required), user_google_email (required). Returns: result
run_script_functionA
Executes a function in a deployed script.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID function_name: Name of function to execute parameters: Optional list of parameters to pass dev_mode: Whether to run latest code vs deployed version
Returns: str: Formatted string with execution result or error
Inputs: script_id (required), function_name (required), user_google_email (required), dev_mode, +1 more. Returns: result
search_contactsA
Search contacts by name, email, phone number, or other fields.
Args: user_google_email (str): The user's Google email address. Required. query (str): Search query string (searches names, emails, phone numbers). page_size (int): Maximum number of results to return (default: 30, max: 30).
Returns: str: Matching contacts with their basic information.
Inputs: query (required), user_google_email (required), page_size. Returns: result
search_customB
Performs a search using Google Custom Search JSON API.
Args: user_google_email (str): The user's Google email address. Required. q (str): The search query. Required. num (int): Number of results to return (1-10). Defaults to 10. start (int): The index of the first result to return (1-based). Defaults to 1. safe (Literal["active", "moderate", "off"]): Safe search level. Defaults to "off". search_type (Optional[Literal["image"]]): Search for images if set to "image". site_search (Optional[str]): Restrict search to a specific site/domain. site_search_filter (Optional[Literal["e", "i"]]): Exclude ("e") or include ("i") site_search results. date_restrict (Optional[str]): Restrict results by date (e.g., "d5" for past 5 days, "m3" for past 3 months). file_type (Optional[str]): Filter by file type (e.g., "pdf", "doc"). language (Optional[str]): Language code for results (e.g., "lang_en"). country (Optional[str]): Country code for results (e.g., "countryUS").
Returns: str: Formatted search results including title, link, and snippet for each result.
Inputs: q (required), user_google_email (required), num, safe, +8 more. Returns: result
search_custom_siterestrictA
Performs a search restricted to specific sites using Google Custom Search.
Args: user_google_email (str): The user's Google email address. Required. q (str): The search query. Required. sites (List[str]): List of sites/domains to search within. num (int): Number of results to return (1-10). Defaults to 10. start (int): The index of the first result to return (1-based). Defaults to 1. safe (Literal["active", "moderate", "off"]): Safe search level. Defaults to "off".
Returns: str: Formatted search results from the specified sites.
Inputs: q (required), sites (required), user_google_email (required), num, +2 more. Returns: result
search_docsB
Searches for Google Docs by name using Drive API (mimeType filter).
Returns: str: A formatted list of Google Docs matching the search query.
Inputs: query (required), user_google_email (required), page_size. Returns: result
search_drive_filesA
Searches for files and folders within a user's Google Drive, including shared drives.
Args:
user_google_email (str): The user's Google email address. Required.
query (str): The search query string. Supports Google Drive search operators.
page_size (int): The maximum number of files to return. Defaults to 10.
drive_id (Optional[str]): ID of the shared drive to search. If None, behavior depends on corpora and include_items_from_all_drives.
include_items_from_all_drives (bool): Whether shared drive items should be included in results. Defaults to True. This is effective when not specifying a drive_id.
corpora (Optional[str]): Bodies of items to query (e.g., 'user', 'domain', 'drive', 'allDrives').
If 'drive_id' is specified and 'corpora' is None, it defaults to 'drive'.
Otherwise, Drive API default behavior applies. Prefer 'user' or 'drive' over 'allDrives' for efficiency.
detailed (bool): Whether to include size, modified time, and link in results. Defaults to True.
Returns: str: A formatted list of found files/folders with their details (ID, name, type, and optionally size, modified time, link).
Inputs: query (required), user_google_email (required), corpora, detailed, +3 more. Returns: result
search_gmail_messagesA
Searches messages in a user's Gmail account based on a query. Returns both Message IDs and Thread IDs for each found message, along with Gmail web interface links for manual verification. Supports pagination via page_token parameter.
Args: query (str): The search query. Supports standard Gmail search operators. user_google_email (str): The user's Google email address. Required. page_size (int): The maximum number of messages to return. Defaults to 10. page_token (Optional[str]): Token for retrieving the next page of results. Use the next_page_token from a previous response.
Returns: str: LLM-friendly structured results with Message IDs, Thread IDs, and clickable Gmail web interface URLs for each found message. Includes pagination token if more results are available.
Inputs: query (required), user_google_email (required), page_size, page_token. Returns: result
search_messagesC
Searches for messages in Google Chat spaces by text content.
Returns: str: A formatted list of messages matching the search query.
Inputs: query (required), user_google_email (required), space_id, page_size. Returns: result
send_gmail_messageA
Sends an email using the user's Gmail account. Supports both new emails and replies with optional attachments. Supports Gmail's "Send As" feature to send from configured alias addresses.
Args: to (str): Recipient email address. subject (str): Email subject. body (str): Email body content. body_format (Literal['plain', 'html']): Email body format. Defaults to 'plain'. attachments (Optional[List[Dict[str, str]]]): Optional list of attachments. Each dict can contain: Option 1 - File path (auto-encodes): - 'path' (required): File path to attach - 'filename' (optional): Override filename - 'mime_type' (optional): Override MIME type (auto-detected if not provided) Option 2 - Base64 content: - 'content' (required): Standard base64-encoded file content (not urlsafe) - 'filename' (required): Name of the file - 'mime_type' (optional): MIME type (defaults to 'application/octet-stream') cc (Optional[str]): Optional CC email address. bcc (Optional[str]): Optional BCC email address. from_name (Optional[str]): Optional sender display name. If provided, the From header will be formatted as 'Name '. from_email (Optional[str]): Optional 'Send As' alias email address. The alias must be configured in Gmail settings (Settings > Accounts > Send mail as). If not provided, the email will be sent from the authenticated user's primary email address. user_google_email (str): The user's Google email address. Required for authentication. thread_id (Optional[str]): Optional Gmail thread ID to reply within. When provided, sends a reply. in_reply_to (Optional[str]): Optional Message-ID of the message being replied to. Used for proper threading. references (Optional[str]): Optional chain of Message-IDs for proper threading. Should include all previous Message-IDs.
Returns: str: Confirmation message with the sent email's message ID.
Examples: # Send a new email send_gmail_message(to="user@example.com", subject="Hello", body="Hi there!")
# Send with a custom display name
send_gmail_message(to="user@example.com", subject="Hello", body="Hi there!", from_name="John Doe")
# Send an HTML email
send_gmail_message(
to="user@example.com",
subject="Hello",
body="<strong>Hi there!</strong>",
body_format="html"
)
# Send from a configured alias (Send As)
send_gmail_message(
to="user@example.com",
subject="Business Inquiry",
body="Hello from my business address...",
from_email="business@mydomain.com"
)
# Send an email with CC and BCC
send_gmail_message(
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com",
subject="Project Update",
body="Here's the latest update..."
)
# Send an email with attachments (using file path)
send_gmail_message(
to="user@example.com",
subject="Report",
body="Please see attached report.",
attachments=[{
"path": "/path/to/report.pdf"
}]
)
# Send an email with attachments (using base64 content)
send_gmail_message(
to="user@example.com",
subject="Report",
body="Please see attached report.",
attachments=[{
"filename": "report.pdf",
"content": "JVBERi0xLjQK...", # base64 encoded PDF
"mime_type": "application/pdf"
}]
)
# Send a reply
send_gmail_message(
to="user@example.com",
subject="Re: Meeting tomorrow",
body="Thanks for the update!",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)Inputs: to (required), body (required), subject (required), user_google_email (required), +9 more. Returns: result
send_messageB
Sends a message to a Google Chat space.
Args: thread_name: Reply in an existing thread by its resource name (e.g. spaces/X/threads/Y). thread_key: Reply in a thread by app-defined key (creates thread if not found).
Returns: str: Confirmation message with sent message details.
Inputs: space_id (required), message_text (required), user_google_email (required), thread_key, +1 more. Returns: result
set_drive_file_permissionsA
Sets file-level sharing settings and controls link sharing for a Google Drive file or folder.
This is a high-level tool for the most common permission changes. Use this to toggle "anyone with the link" access or configure file-level sharing behavior. For managing individual user/group permissions, use share_drive_file or update_drive_permission instead.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder. Required. link_sharing (Optional[str]): Control "anyone with the link" access for the file. - "off": Disable "anyone with the link" access for this file. - "reader": Anyone with the link can view. - "commenter": Anyone with the link can comment. - "writer": Anyone with the link can edit. writers_can_share (Optional[bool]): Whether editors can change permissions and share. If False, only the owner can share. Defaults to None (no change). copy_requires_writer_permission (Optional[bool]): Whether viewers and commenters are prevented from copying, printing, or downloading. Defaults to None (no change).
Returns: str: Summary of all permission changes applied to the file.
Inputs: file_id (required), user_google_email (required), link_sharing, writers_can_share, +1 more. Returns: result
set_publish_settingsB
Updates the publish settings of a form.
Args: user_google_email (str): The user's Google email address. Required. form_id (str): The ID of the form to update publish settings for. publish_as_template (bool): Whether to publish as a template. Defaults to False. require_authentication (bool): Whether to require authentication to view/submit. Defaults to False.
Returns: str: Confirmation message of the successful publish settings update.
Inputs: form_id (required), user_google_email (required), publish_as_template, require_authentication. Returns: result
start_google_authA
Manually initiate Google OAuth authentication flow.
NOTE: This is a legacy OAuth 2.0 tool and is disabled when OAuth 2.1 is enabled. The authentication system automatically handles credential checks and prompts for authentication when needed. Only use this tool if:
You need to re-authenticate with different credentials
You want to proactively authenticate before using other tools
The automatic authentication flow failed and you need to retry
In most cases, simply try calling the Google Workspace tool you need - it will automatically handle authentication if required.
Inputs: service_name (required), user_google_email. Returns: result
transfer_drive_ownershipA
Transfers ownership of a Google Drive file or folder to another user.
This is an irreversible operation. The current owner will become an editor. Only works within the same Google Workspace domain or for personal accounts.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder to transfer. Required. new_owner_email (str): Email address of the new owner. Required. move_to_new_owners_root (bool): If True, moves the file to the new owner's My Drive root. Defaults to False.
Returns: str: Confirmation of the ownership transfer.
Inputs: file_id (required), new_owner_email (required), user_google_email (required), move_to_new_owners_root. Returns: result
update_conditional_formattingA
Updates an existing conditional formatting rule by index on a sheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (Optional[str]): A1-style range to apply the updated rule (optionally with sheet name). If omitted, existing ranges are preserved. rule_index (int): Index of the rule to update (0-based). condition_type (Optional[str]): Sheets condition type. If omitted, the existing rule's type is preserved. condition_values (Optional[Union[str, List[Union[str, int, float]]]]): Values for the condition. background_color (Optional[str]): Hex background color when condition matches. text_color (Optional[str]): Hex text color when condition matches. sheet_name (Optional[str]): Sheet name to locate the rule when range_name is omitted. Defaults to first sheet. gradient_points (Optional[Union[str, List[dict]]]): If provided, updates the rule to a gradient color scale using these points.
Returns: str: Confirmation of the updated rule and the current rule state.
Inputs: rule_index (required), spreadsheet_id (required), user_google_email (required), range_name, +6 more. Returns: result
update_contactA
Update an existing contact. Note: This replaces fields, not merges them.
Args: user_google_email (str): The user's Google email address. Required. contact_id (str): The contact ID to update. given_name (Optional[str]): New first name. family_name (Optional[str]): New last name. email (Optional[str]): New email address. phone (Optional[str]): New phone number. organization (Optional[str]): New company/organization name. job_title (Optional[str]): New job title. notes (Optional[str]): New notes.
Returns: str: Confirmation with updated contact details.
Inputs: contact_id (required), user_google_email (required), email, notes, +5 more. Returns: result
update_contact_groupC
Update a contact group's name.
Args: user_google_email (str): The user's Google email address. Required. group_id (str): The contact group ID to update. name (str): The new name for the contact group.
Returns: str: Confirmation with updated group details.
Inputs: name (required), group_id (required), user_google_email (required). Returns: result
update_deploymentC
Updates an existing deployment configuration.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID deployment_id: The deployment ID to update description: Optional new description
Returns: str: Formatted string confirming update
Inputs: script_id (required), deployment_id (required), user_google_email (required), description. Returns: result
update_drive_fileA
Updates metadata and properties of a Google Drive file.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file to update. Required. name (Optional[str]): New name for the file. description (Optional[str]): New description for the file. mime_type (Optional[str]): New MIME type (note: changing type may require content upload). add_parents (Optional[str]): Comma-separated folder IDs to add as parents. remove_parents (Optional[str]): Comma-separated folder IDs to remove from parents. starred (Optional[bool]): Whether to star/unstar the file. trashed (Optional[bool]): Whether to move file to/from trash. writers_can_share (Optional[bool]): Whether editors can share the file. copy_requires_writer_permission (Optional[bool]): Whether copying requires writer permission. properties (Optional[dict]): Custom key-value properties for the file.
Returns: str: Confirmation message with details of the updates applied.
Inputs: file_id (required), user_google_email (required), name, starred, +8 more. Returns: result
update_drive_permissionA
Updates an existing permission on a Google Drive file or folder.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder. Required. permission_id (str): The ID of the permission to update (from get_drive_file_permissions). Required. role (Optional[str]): New role - 'reader', 'commenter', or 'writer'. If not provided, role unchanged. expiration_time (Optional[str]): Expiration time in RFC 3339 format (e.g., "2025-01-15T00:00:00Z"). Set or update when permission expires.
Returns: str: Confirmation with updated permission details.
Inputs: file_id (required), permission_id (required), user_google_email (required), role, +1 more. Returns: result
update_paragraph_styleA
Apply paragraph-level formatting, heading styles, and/or list formatting to a range in a Google Doc.
This tool can apply named heading styles (H1-H6) for semantic document structure, create bulleted or numbered lists with nested indentation, and customize paragraph properties like alignment, spacing, and indentation. All operations can be applied in a single call.
Args: user_google_email: User's Google email address document_id: Document ID to modify start_index: Start position (1-based) end_index: End position (exclusive) - should cover the entire paragraph heading_level: Heading level 0-6 (0 = NORMAL_TEXT, 1 = H1, 2 = H2, etc.) Use for semantic document structure alignment: Text alignment - 'START' (left), 'CENTER', 'END' (right), or 'JUSTIFIED' line_spacing: Line spacing multiplier (1.0 = single, 1.5 = 1.5x, 2.0 = double) indent_first_line: First line indent in points (e.g., 36 for 0.5 inch) indent_start: Left/start indent in points indent_end: Right/end indent in points space_above: Space above paragraph in points (e.g., 12 for one line) space_below: Space below paragraph in points list_type: Create a list from existing paragraphs ('UNORDERED' for bullets, 'ORDERED' for numbers) list_nesting_level: Nesting level for lists (0-8, where 0 is top level, default is 0) Use higher levels for nested/indented list items
Returns: str: Confirmation message with formatting details
Examples: # Apply H1 heading style update_paragraph_style(document_id="...", start_index=1, end_index=20, heading_level=1)
# Create a bulleted list
update_paragraph_style(document_id="...", start_index=1, end_index=50,
list_type="UNORDERED")
# Create a nested numbered list item
update_paragraph_style(document_id="...", start_index=1, end_index=30,
list_type="ORDERED", list_nesting_level=1)
# Apply H2 heading with custom spacing
update_paragraph_style(document_id="...", start_index=1, end_index=30,
heading_level=2, space_above=18, space_below=12)
# Center-align a paragraph with double spacing
update_paragraph_style(document_id="...", start_index=1, end_index=50,
alignment="CENTER", line_spacing=2.0)Inputs: end_index (required), document_id (required), start_index (required), user_google_email (required), +10 more. Returns: result
update_script_contentA
Updates or creates files in a script project.
Args: service: Injected Google API service client user_google_email: User's email address script_id: The script project ID files: List of file objects with name, type, and source
Returns: str: Formatted string confirming update with file list
Inputs: files (required), script_id (required), user_google_email (required). Returns: result
update_taskB
Update an existing task.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list containing the task. task_id (str): The ID of the task to update. title (Optional[str]): New title for the task. notes (Optional[str]): New notes/description for the task. status (Optional[str]): New status ("needsAction" or "completed"). due (Optional[str]): New due date in RFC 3339 format.
Returns: str: Confirmation message with updated task details.
Inputs: task_id (required), task_list_id (required), user_google_email (required), due, +3 more. Returns: result
update_task_listC
Update an existing task list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to update. title (str): The new title for the task list.
Returns: str: Confirmation message with updated task list details.
Inputs: title (required), task_list_id (required), user_google_email (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 144 tools
Most tools are scoped to a distinct Google service + resource + action, so the bulk of the set is separable. However there is meaningful overlap within Drive permissions (share_drive_file, batch_share_drive_file, set_drive_file_permissions, update_drive_permission, remove_drive_permission, get_drive_file_permissions, get_drive_shareable_link, check_drive_file_public_access) and content retrieval (get_drive_file_content vs get_drive_file_download_url vs get_doc_content vs get_doc_as_markdown), which can cause misselection. Descriptions help but boundaries require careful reading.
The dominant convention is verb_noun with service prefixes (list_gmail_messages, send_gmail_message, create_event, update_task), which is readable. But there are deviations: unprefixed generic names like get_page (Slides), get_messages/send_message (Chat), and mixed verbs (modify_event vs update_task, search_ vs list_). Consistency is imperfect though still interpretable.
144 tools is far beyond a well-scoped surface and will overwhelm agents attempting selection. While each Google service individually needs several tools, bundling the entire Workspace suite into one server makes the set heavy and hard to navigate, with many fine-grained permission and formatting variants adding bulk.
Coverage is broad and deep across Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts, Chat, Apps Script, and Custom Search, with full create/read/update/delete lifecycles in most areas. A few minor gaps exist (e.g., partial Gmail settings management beyond filters/labels), but overall the surface is highly complete.
Maintenance
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides natural language control over Google Workspace services (Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Chat) via MCP, with OAuth 2.1 multi-user authentication.100MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that exposes 17 Google Workspace APIs (e.g., Gmail, Drive, Calendar) as auto-generated tools for AI assistants, enabling natural language control of Google services.-
- AlicenseBqualityBmaintenanceMCP server that gives AI agents direct access to Google services including Gmail, Calendar, Drive, and more, with multi-account OAuth support. Enables reading and sending email, managing calendar events, and interacting with Google files through natural language.1344,134 npm1MIT
- AlicenseBqualityDmaintenanceFull natural language control over Google Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Contacts, and Chat through all MCP clients, AI assistants and developer tools.124MIT