Skip to main content
Glama
taylorwilsdon

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

list_calendars

Retrieve a formatted list of accessible calendars for a user, including details like summary, ID, and primary status, using their Google email address.

Instructions

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYes
user_google_emailYes

Implementation Reference

  • The complete handler implementation for the 'list_calendars' tool, including decorators for registration (@server.tool()), error handling, and Google service authentication. This function lists all calendars accessible to the user and returns a formatted string summary.
    @server.tool()
    @handle_http_errors("list_calendars", is_read_only=True, service_type="calendar")
    @require_google_service("calendar", "calendar_read")
    async def list_calendars(service, user_google_email: str) -> str:
        """
        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).
        """
        logger.info(f"[list_calendars] Invoked. Email: '{user_google_email}'")
    
        calendar_list_response = await asyncio.to_thread(
            lambda: service.calendarList().list().execute()
        )
        items = calendar_list_response.get("items", [])
        if not items:
            return f"No calendars found for {user_google_email}."
    
        calendars_summary_list = [
            f"- \"{cal.get('summary', 'No Summary')}\"{' (Primary)' if cal.get('primary') else ''} (ID: {cal['id']})"
            for cal in items
        ]
        text_output = (
            f"Successfully listed {len(items)} calendars for {user_google_email}:\n"
            + "\n".join(calendars_summary_list)
        )
        logger.info(f"Successfully listed {len(items)} calendars for {user_google_email}.")
        return text_output
  • The @server.tool() decorator registers the list_calendars function as an MCP tool.
    @server.tool()
  • Function signature and docstring defining the input parameters and output format, which serves as the tool schema for MCP.
    async def list_calendars(service, user_google_email: str) -> str:
        """
        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).
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 this is a retrieval operation and mentions authentication, but doesn't describe important behavioral aspects like whether this is a read-only operation, what happens with invalid inputs, rate limits, pagination behavior, or error handling.

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 sized with three sentences that each serve a purpose: stating the tool's function, documenting one parameter, and describing the return format. It's front-loaded with the core purpose first, though the parameter documentation could be more complete.

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

Completeness2/5

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

For a tool with 2 required parameters, no annotations, and no output schema, the description is incomplete. It documents only half of the parameters, provides minimal behavioral context, and while it describes the return format, it doesn't explain the tool's full behavior or usage context given the complexity of calendar operations.

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

Parameters2/5

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

The description documents only one of the two parameters (user_google_email) and provides no information about the 'service' parameter. With 0% schema description coverage, the description fails to compensate for the undocumented 'service' parameter, leaving half of the required inputs unexplained.

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 ('retrieves') and resource ('list of calendars accessible to the authenticated user'), distinguishing it from siblings like get_events or list_spaces. However, it doesn't explicitly differentiate from other list/search tools like list_docs_in_folder or search_drive_files beyond the calendar domain.

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 when not to use it, prerequisites beyond authentication, or how it differs from similar tools like get_events or list_spaces that might also involve calendar data.

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