Skip to main content
Glama
ZatesloFL

Google Workspace MCP Server

by ZatesloFL

clear_completed_tasks

Remove completed tasks from a Google Workspace task list. This tool marks completed tasks as hidden, helping users maintain a clean and organized task list.

Instructions

Clear all completed tasks from a task list. The tasks will be marked as hidden.

Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to clear completed tasks from.

Returns: str: Confirmation message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_list_idYes
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'clear_completed_tasks' tool. It is registered via @server.tool(), requires Google Tasks authentication, handles errors, logs the action, calls the Google Tasks API to clear (hide) all completed tasks in the specified task list, and returns a confirmation message.
    @server.tool()  # type: ignore
    @require_google_service("tasks", "tasks")  # type: ignore
    @handle_http_errors("clear_completed_tasks", service_type="tasks")  # type: ignore
    async def clear_completed_tasks(
        service: Resource,
        user_google_email: str,
        task_list_id: str
    ) -> str:
        """
        Clear all completed tasks from a task list. The tasks will be marked as hidden.
    
        Args:
            user_google_email (str): The user's Google email address. Required.
            task_list_id (str): The ID of the task list to clear completed tasks from.
    
        Returns:
            str: Confirmation message.
        """
        logger.info(f"[clear_completed_tasks] Invoked. Email: '{user_google_email}', Task List ID: {task_list_id}")
    
        try:
            await asyncio.to_thread(
                service.tasks().clear(tasklist=task_list_id).execute
            )
    
            response = f"All completed tasks have been cleared from task list {task_list_id} for {user_google_email}. The tasks are now hidden and won't appear in default task list views."
    
            logger.info(f"Cleared completed tasks from list {task_list_id} for {user_google_email}")
            return response
    
        except HttpError as error:
            message = f"API error: {error}. You might need to re-authenticate. LLM: Try 'start_google_auth' with the user's email ({user_google_email}) and service_name='Google Tasks'."
            logger.error(message, exc_info=True)
            raise Exception(message)
        except Exception as e:
            message = f"Unexpected error: {e}."
            logger.exception(message)
            raise Exception(message)
  • The @server.tool() decorator registers the clear_completed_tasks function as an MCP tool.
    @server.tool()  # type: ignore
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. It states tasks will be 'marked as hidden' rather than permanently deleted, which is useful behavioral context. However, it doesn't mention authentication requirements, rate limits, whether the action is reversible, or what happens if no completed tasks exist. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 with clear sections for purpose, arguments, and return value. It's appropriately sized at three sentences plus structured parameter documentation. Every sentence adds value, though the 'Args' and 'Returns' sections could be integrated more seamlessly into the narrative flow.

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

Completeness4/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 (2 parameters, mutation operation) and the presence of an output schema (which handles return value documentation), the description is reasonably complete. It covers the core purpose, parameters, and behavioral effect ('marked as hidden'). The main gap is lack of usage guidance relative to sibling tools, but otherwise it provides sufficient context for basic understanding.

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 descriptions. The description includes an 'Args' section that documents both parameters with brief explanations, adding meaningful semantics beyond the bare schema. However, it doesn't specify format requirements (e.g., email validation) or where to find the task_list_id, leaving some gaps.

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 action ('clear all completed tasks') and resource ('from a task list'), with the specific effect that tasks will be marked as hidden. However, it doesn't explicitly differentiate this tool from sibling tools like 'delete_task' or 'delete_task_list', which handle different types of task-related operations.

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. With sibling tools like 'delete_task' (for individual tasks) and 'delete_task_list' (for entire lists), there's no indication of when clearing completed tasks is preferred over deletion or other task management operations.

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