Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

get_spreadsheet_info

Retrieve detailed information about a Google Sheets spreadsheet, including its title and sheet list, by providing the user's email and spreadsheet ID.

Instructions

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 and sheets list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYes
spreadsheet_idYes
user_google_emailYes

Implementation Reference

  • The handler function for the 'get_spreadsheet_info' tool. It uses the Google Sheets API to fetch spreadsheet details, including title and sheets with their grid sizes, and returns a formatted string summary. Registered via @server.tool() decorator.
    @server.tool()
    @handle_http_errors("get_spreadsheet_info", is_read_only=True, service_type="sheets")
    @require_google_service("sheets", "sheets_read")
    async def get_spreadsheet_info(
        service,
        user_google_email: str,
        spreadsheet_id: str,
    ) -> str:
        """
        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 and sheets list.
        """
        logger.info(f"[get_spreadsheet_info] Invoked. Email: '{user_google_email}', Spreadsheet ID: {spreadsheet_id}")
    
        spreadsheet = await asyncio.to_thread(
            service.spreadsheets().get(spreadsheetId=spreadsheet_id).execute
        )
    
        title = spreadsheet.get("properties", {}).get("title", "Unknown")
        sheets = spreadsheet.get("sheets", [])
    
        sheets_info = []
        for sheet in sheets:
            sheet_props = sheet.get("properties", {})
            sheet_name = sheet_props.get("title", "Unknown")
            sheet_id = sheet_props.get("sheetId", "Unknown")
            grid_props = sheet_props.get("gridProperties", {})
            rows = grid_props.get("rowCount", "Unknown")
            cols = grid_props.get("columnCount", "Unknown")
    
            sheets_info.append(
                f"  - \"{sheet_name}\" (ID: {sheet_id}) | Size: {rows}x{cols}"
            )
    
        text_output = (
            f"Spreadsheet: \"{title}\" (ID: {spreadsheet_id})\n"
            f"Sheets ({len(sheets)}):\n"
            + "\n".join(sheets_info) if sheets_info else "  No sheets found"
        )
    
        logger.info(f"Successfully retrieved info for spreadsheet {spreadsheet_id} for {user_google_email}.")
        return text_output
  • Imports and exports the get_spreadsheet_info tool function via __init__.py, making it available when importing the gs sheets module.
    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",
    ]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information (implying read-only) and describes the return format, but doesn't mention authentication requirements, rate limits, error conditions, or whether it requires specific permissions. For a tool with 3 required parameters and no annotation coverage, this is insufficient.

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 appropriately concise with three clear sections (purpose, args, returns) in just 4 sentences. Each sentence earns its place by providing essential information without redundancy. The structure is front-loaded with the core purpose first, followed by parameter and return details.

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 moderate complexity (3 required parameters, no annotations, no output schema), the description is partially complete. It covers the basic purpose and return format but lacks behavioral context, usage guidance, and full parameter documentation. The absence of an output schema means the description should ideally explain return values more thoroughly, which it does to some extent by mentioning 'formatted spreadsheet information including title and sheets list.'

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description explicitly documents 2 of the 3 parameters (user_google_email and spreadsheet_id) with their purposes, but completely omits the 'service' parameter. This partial compensation results in a baseline score of 3, as it adds meaningful context for two parameters but leaves one undocumented.

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 with a specific verb ('Gets') and resource ('spreadsheet'), and specifies what information is retrieved ('including its sheets'). However, it doesn't differentiate from sibling tools like 'list_spreadsheets' or 'get_drive_file_content', which could provide similar spreadsheet-related functionality.

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. There's no mention of when this tool is appropriate compared to sibling tools like 'list_spreadsheets' (for listing) or 'read_sheet_values' (for content), nor any prerequisites or exclusions for usage.

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

Related 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/taylorwilsdon/google_workspace_mcp'

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