This report introduces ToolsForMCPServer
, an enhanced Google Apps Script library that expands the capabilities of Gemini CLI. It showcases new tools that streamline complex workflows, with a special emphasis on facilitating seamless file content transfer and management between a user's local environment and Google Drive.
This report details two methods for processing files using the Gemini CLI and a Google Apps Script MCP server: direct Base64 encoding and indirect transfer via the Google Drive API using ggsrun
. The direct method proved ineffective due to token limits. The recommended approach, leveraging ggsrun
, allows for efficient, scalable file transfers by using file IDs instead of embedding content within the prompt, enabling advanced automation capabilities.
The Gemini CLI provides a powerful command-line interface for interacting with Google's Gemini models. By leveraging the Model Context Protocol (MCP), the CLI can be extended with custom tools. This report explores the integration of the Gemini CLI with an MCP server built using Google Apps Script Web Apps. We demonstrate how this combination simplifies authorization for Google Workspace APIs (Gmail, Drive, Calendar, etc.), allowing Gemini to execute complex, multi-step tasks directly within the Google ecosystem. We provide setup instructions and several practical examples showcasing how this integration unlocks significant potential for automation and productivity enhancement.
The Gemini CLI can be integrated with Google Workspace via Google Apps Script to securely access personal data, enabling powerful automations like email summaries and calendar management.
The recently released Gemini CLI is a powerful command-line interface for interacting with Google's Gemini models and cloud resources. Ref While powerful on its own, its utility can be significantly enhanced by connecting it to a user's personal Google resources, such as Google Sheets, Docs, Slides, Gmail, and Calendar.
The Gemini API recently introduced the URL context tool, a feature designed to allow the model to directly fetch and utilize content from specified URLs to ground its responses. Ref
This report provides a practical demonstration of this tool's capabilities. We will investigate its impact on two critical aspects of AI model interaction: the accuracy of the generated response and the total token consumption, which directly affects API costs.
This article announces that the Gemini API's Python client library now supports "growing image" generation, a feature previously unavailable. Sample scripts for Python and Node.js are provided to demonstrate this new capability.
This script provides a simple example for generating Text-To-Speech (TTS) using the Gemini API within Google Apps Script. The Gemini API generates audio data in the audio/L16;codec=pcm;rate=24000
format, which is not directly playable. Since there's no built-in method to convert this to a standard audio/wav
format, this sample script includes a custom function to handle the conversion.
- The provided
convertL16ToWav_
function is specifically designed for theaudio/L16;codec=pcm;rate=24000
MIME type. Using it with other audio formats will result in an error. - The script uses a hardcoded WAV header. This header assumes specific audio parameters (e.g., sample rate, bit depth, number of channels) that match the Gemini API's output for this format. If the Gemini API's output format changes, this header might need adjustment.