delete_task_list
Remove a task list and all associated tasks from Google Workspace. Requires the user's Google email address and the task list ID for deletion.
Instructions
Delete a task list. Note: This will also delete all tasks in the list.
Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to delete.
Returns: str: Confirmation message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_list_id | Yes | ||
| user_google_email | Yes |
Implementation Reference
- gtasks/tasks_tools.py:246-284 (handler)The main handler function for the 'delete_task_list' tool. It deletes the specified task list using the Google Tasks API and returns a confirmation message. Includes decorators for tool registration (@server.tool()), authentication (@require_google_service), and error handling (@handle_http_errors).@server.tool() # type: ignore @require_google_service("tasks", "tasks") # type: ignore @handle_http_errors("delete_task_list", service_type="tasks") # type: ignore async def delete_task_list( service: Resource, user_google_email: str, task_list_id: str ) -> str: """ Delete a task list. Note: This will also delete all tasks in the list. Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to delete. Returns: str: Confirmation message. """ logger.info(f"[delete_task_list] Invoked. Email: '{user_google_email}', Task List ID: {task_list_id}") try: await asyncio.to_thread( service.tasklists().delete(tasklist=task_list_id).execute ) response = f"Task list {task_list_id} has been deleted for {user_google_email}. All tasks in this list have also been deleted." logger.info(f"Deleted task 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)