Skip to main content
Glama
ZatesloFL

Google Workspace MCP Server

by ZatesloFL

create_task

Add a new task to a Google Workspace task list using a user’s email, task list ID, and optional details like title, notes, due date, parent task, and sibling position.

Instructions

Create a new task in a task list.

Args: user_google_email (str): The user's Google email address. Required. task_list_id (str): The ID of the task list to create the task in. title (str): The title of the task. notes (Optional[str]): Notes/description for the task. due (Optional[str]): Due date in RFC 3339 format (e.g., "2024-12-31T23:59:59Z"). parent (Optional[str]): Parent task ID (for subtasks). previous (Optional[str]): Previous sibling task ID (for positioning).

Returns: str: Confirmation message with the new task ID and details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dueNo
notesNo
parentNo
previousNo
task_list_idYes
titleYes
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'create_task' tool. It is registered via the @server.tool() decorator, requires Google Tasks service authentication, handles HTTP errors, and creates a new task in the specified task list using the Google Tasks API's tasks.insert method. Includes input parameters for title, notes, due date, parent, and previous sibling for positioning.
    @server.tool()  # type: ignore
    @require_google_service("tasks", "tasks")  # type: ignore
    @handle_http_errors("create_task", service_type="tasks")  # type: ignore
    async def create_task(
        service: Resource,
        user_google_email: str,
        task_list_id: str,
        title: str,
        notes: Optional[str] = None,
        due: Optional[str] = None,
        parent: Optional[str] = None,
        previous: Optional[str] = None
    ) -> str:
        """
        Create a new task in a task list.
    
        Args:
            user_google_email (str): The user's Google email address. Required.
            task_list_id (str): The ID of the task list to create the task in.
            title (str): The title of the task.
            notes (Optional[str]): Notes/description for the task.
            due (Optional[str]): Due date in RFC 3339 format (e.g., "2024-12-31T23:59:59Z").
            parent (Optional[str]): Parent task ID (for subtasks).
            previous (Optional[str]): Previous sibling task ID (for positioning).
    
        Returns:
            str: Confirmation message with the new task ID and details.
        """
        logger.info(f"[create_task] Invoked. Email: '{user_google_email}', Task List ID: {task_list_id}, Title: '{title}'")
    
        try:
            body = {
                "title": title
            }
            if notes:
                body["notes"] = notes
            if due:
                body["due"] = due
    
            params = {"tasklist": task_list_id, "body": body}
            if parent:
                params["parent"] = parent
            if previous:
                params["previous"] = previous
    
            result = await asyncio.to_thread(
                service.tasks().insert(**params).execute
            )
    
            response = f"""Task Created for {user_google_email}:
    - Title: {result['title']}
    - ID: {result['id']}
    - Status: {result.get('status', 'N/A')}
    - Updated: {result.get('updated', 'N/A')}"""
    
            if result.get('due'):
                response += f"\n- Due Date: {result['due']}"
            if result.get('notes'):
                response += f"\n- Notes: {result['notes']}"
            if result.get('webViewLink'):
                response += f"\n- Web View Link: {result['webViewLink']}"
    
            logger.info(f"Created task '{title}' with ID {result['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 create_task function as an MCP tool.
    @server.tool()  # type: ignore
Behavior3/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 correctly identifies this as a creation operation and specifies the return format, but lacks details about authentication requirements, error conditions, rate limits, or whether the operation is idempotent. The description adds basic context but misses important behavioral traits for a mutation tool.

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

Conciseness5/5

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

The description is well-structured with clear sections (purpose, args, returns) and every sentence adds value. It's appropriately sized for a tool with 7 parameters and efficiently communicates essential information without redundancy or unnecessary elaboration.

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?

For a creation tool with no annotations, the description does well by documenting all parameters and specifying the return format. However, it lacks information about authentication requirements, error handling, and how this tool relates to siblings. The presence of an output schema reduces the need to explain return values, but more behavioral context would improve completeness.

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

Parameters5/5

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

Given 0% schema description coverage, the description compensates fully by providing detailed parameter documentation. It clearly explains all 7 parameters, their purposes, data types, optionality, and even provides format examples (e.g., RFC 3339 for 'due'). This adds significant value beyond what the bare schema provides.

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 ('Create a new task') and resource ('in a task list'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'create_task_list' or 'update_task', which would require a more specific comparison to achieve a perfect score.

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 like 'create_task_list' (for creating task lists) or 'update_task' (for modifying existing tasks). It also doesn't mention prerequisites such as needing an existing task list ID or appropriate permissions, leaving usage context unclear.

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