Skip to main content
Glama
ZatesloFL

Google Workspace MCP Server

by ZatesloFL

create_spreadsheet

Create a new Google Spreadsheet with custom title and optional sheet names for a specified user. Returns spreadsheet ID and URL for quick access.

Instructions

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 and URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheet_namesNo
titleYes
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'create_spreadsheet' tool. It creates a new Google Spreadsheet using the Google Sheets API v4, with optional initial sheet names. Includes authentication, error handling, and logging.
    @server.tool()
    @handle_http_errors("create_spreadsheet", service_type="sheets")
    @require_google_service("sheets", "sheets_write")
    async def create_spreadsheet(
        service,
        user_google_email: str,
        title: str,
        sheet_names: Optional[List[str]] = None,
    ) -> str:
        """
        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 and URL.
        """
        logger.info(f"[create_spreadsheet] Invoked. Email: '{user_google_email}', Title: {title}")
    
        spreadsheet_body = {
            "properties": {
                "title": title
            }
        }
    
        if sheet_names:
            spreadsheet_body["sheets"] = [
                {"properties": {"title": sheet_name}} for sheet_name in sheet_names
            ]
    
        spreadsheet = await asyncio.to_thread(
            service.spreadsheets().create(body=spreadsheet_body).execute
        )
    
        spreadsheet_id = spreadsheet.get("spreadsheetId")
        spreadsheet_url = spreadsheet.get("spreadsheetUrl")
    
        text_output = (
            f"Successfully created spreadsheet '{title}' for {user_google_email}. "
            f"ID: {spreadsheet_id} | URL: {spreadsheet_url}"
        )
    
        logger.info(f"Successfully created spreadsheet for {user_google_email}. ID: {spreadsheet_id}")
        return text_output
  • Registers and exports the 'create_spreadsheet' tool as part of the gsheets module's public API via import and __all__.
    from .sheets_tools import (
        list_spreadsheets,
        get_spreadsheet_info,
        read_sheet_values,
        modify_sheet_values,
        create_spreadsheet,
        create_sheet,
    )
    
    __all__ = [
        "list_spreadsheets",
        "get_spreadsheet_info", 
        "read_sheet_values",
        "modify_sheet_values",
        "create_spreadsheet",
        "create_sheet",
  • Type hints and docstring defining the input schema (parameters) and output for the create_spreadsheet tool.
    async def create_spreadsheet(
        service,
        user_google_email: str,
        title: str,
        sheet_names: Optional[List[str]] = None,
    ) -> str:
        """
        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 and URL.
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates a spreadsheet, implying a write/mutation operation, but doesn't cover critical aspects like required permissions (e.g., Google Drive access), rate limits, error conditions, or whether the operation is idempotent. The return value is mentioned but lacks detail on format or potential errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It front-loads the core purpose in the first sentence, followed by clear sections for Args and Returns. Each sentence adds value, with no redundant or vague phrasing. Minor improvements could include integrating the sections more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a write operation with 3 parameters, no annotations, but an output schema exists), the description is partially complete. It covers parameters well and mentions the return value, but lacks behavioral context (e.g., auth, errors) and usage guidelines. The output schema reduces the need to detail return values, but other gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics for all three parameters: 'user_google_email' is explained as 'The user's Google email address', 'title' as 'The title of the new spreadsheet', and 'sheet_names' with details on default behavior and optionality. This clarifies beyond the bare schema, though it doesn't cover validation rules (e.g., email format).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Creates a new Google Spreadsheet.' It specifies the verb ('Creates') and resource ('Google Spreadsheet'), making the action unambiguous. However, it doesn't differentiate from sibling tools like 'create_doc' or 'create_sheet', which are similar creation tools for different Google Workspace resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication needs), compare it to similar tools like 'create_sheet' (which might create a single sheet versus a full spreadsheet), or specify use cases. The agent must infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZatesloFL/google_workspace_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server