AI Agents Automate Google Workspace
A new open-source command-line tool allows AI agents to securely access and automate tasks within Google Workspace using OAuth authentication, including sorting emails, generating documents, and updating spreadsheets. Business leaders should start by "identifying time-consuming tasks and testing automation on low-risk activities" while setting granular permissions to protect data.
The new command-line tool, officially named "gws," was released on GitHub in early March 2026 and is designed for both human developers and AI agents. Unlike most command-line interfaces with a fixed set of commands, `gws` dynamically builds its capabilities at runtime by reading Google's Discovery Service, ensuring it always has the latest API endpoints available. This developer-focused tool complements Google's earlier release of Workspace Studio in December 2025, a no-code platform aimed at business users for creating AI agents. While Workspace Studio allows users to describe what they want to automate in plain language, `gws` provides a more granular, scriptable interface for deeper integration. The `gws` tool is explicitly designed to work with third-party AI agents, with its documentation providing a dedicated integration guide for the popular open-source AI agent, OpenClaw. This move signals Google's acknowledgment of the growing importance of the agentic AI landscape. By functioning as a Model Context Protocol (MCP) server, `gws` embraces an open standard for communication between AI agents and external tools. This allows any MCP-compatible client, such as Anthropic's Claude Desktop or Google's own Gemini CLI, to interact with Google Workspace APIs in a structured way. The tool simplifies what was previously a complex process for developers, who had to navigate three separate APIs with different authentication flows to perform a series of tasks across Gmail, Drive, and Calendar. Now, authentication is handled once through OAuth, and all operations produce structured JSON output, which is easily parsable by AI agents. Although published by Google, the `gws` tool is not an officially supported Google product and is intended for developers, coming from the "developer samples" collection for Google Workspace APIs. It is written in the Rust programming language and distributed through the npm package manager.