Skip to main content
Glama

create_task

Add tasks to Todoist with content, due dates, priorities, labels, and project organization to manage your to-do list.

Instructions

Create a new task in Todoist.

Args:
    content: The task content/title
    description: Detailed description of the task
    project_id: Project ID to add the task to
    section_id: Section ID within the project
    parent_id: Parent task ID (for subtasks)
    labels: List of label names
    priority: Priority from 1 (normal) to 4 (urgent)
    due_string: Human readable due date (e.g., 'tomorrow', 'next Monday')
    due_date: ISO 8601 formatted due date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
descriptionNo
project_idNo
section_idNo
parent_idNo
labelsNo
priorityNo
due_stringNo
due_dateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler for 'create_task'. Decorated with @mcp.tool() for automatic registration and schema generation from parameters. Delegates to TodoistClient.create_task and formats the response.
    @mcp.tool()
    async def create_task(
        content: str,
        description: str = "",
        project_id: Optional[str] = None,
        section_id: Optional[str] = None,
        parent_id: Optional[str] = None,
        labels: Optional[List[str]] = None,
        priority: int = 1,
        due_string: Optional[str] = None,
        due_date: Optional[str] = None
    ) -> str:
        """Create a new task in Todoist.
        
        Args:
            content: The task content/title
            description: Detailed description of the task
            project_id: Project ID to add the task to
            section_id: Section ID within the project
            parent_id: Parent task ID (for subtasks)
            labels: List of label names
            priority: Priority from 1 (normal) to 4 (urgent)
            due_string: Human readable due date (e.g., 'tomorrow', 'next Monday')
            due_date: ISO 8601 formatted due date
        """
        _check_client()
        
        task = await todoist_client.create_task(
            content=content,
            description=description,
            project_id=project_id,
            section_id=section_id,
            parent_id=parent_id,
            labels=labels or [],
            priority=priority,
            due_string=due_string,
            due_date=due_date
        )
        
        return (
            f"Task created successfully!\n"
            f"ID: {task.id}\n"
            f"Title: {task.content}\n"
            f"URL: {task.url}"
        )
  • Helper method in TodoistClient that constructs the payload and makes the HTTP POST request to Todoist API endpoint /tasks to create the task.
    async def create_task(self, 
                         content: str,
                         description: str = "",
                         project_id: Optional[str] = None,
                         section_id: Optional[str] = None,
                         parent_id: Optional[str] = None,
                         order: Optional[int] = None,
                         labels: Optional[List[str]] = None,
                         priority: int = 1,
                         due_string: Optional[str] = None,
                         due_date: Optional[str] = None) -> TodoistTask:
        """Create a new task."""
        payload = {
            "content": content,
            "description": description,
            "priority": priority
        }
        
        if project_id:
            payload["project_id"] = project_id
        if section_id:
            payload["section_id"] = section_id
        if parent_id:
            payload["parent_id"] = parent_id
        if order is not None:
            payload["order"] = order
        if labels:
            payload["labels"] = labels
        if due_string:
            payload["due_string"] = due_string
        if due_date:
            payload["due_date"] = due_date
        
        data = await self._request("POST", "/tasks", json=payload)
        return TodoistTask(**data)
  • Pydantic model defining the TodoistTask structure, used for parsing API responses in create_task and other operations.
    class TodoistTask(BaseModel):
        """Represents a Todoist task."""
        id: str
        content: str
        description: str = ""
        is_completed: bool = False
        labels: List[str] = []
        priority: int = 1
        due_string: Optional[str] = None
        due_date: Optional[str] = None
        project_id: str = ""
        section_id: Optional[str] = None
        parent_id: Optional[str] = None
        order: int = 0
        url: str = ""
        created_at: str = ""
  • The @mcp.tool() decorator registers the create_task function as an MCP tool with the name 'create_task' and auto-generates input schema from type hints.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't address authentication requirements, rate limits, error conditions, or what happens when creating duplicate tasks. It provides basic parameter explanations but lacks operational context.

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 efficiently structured with a clear purpose statement followed by a well-organized parameter list. Each parameter explanation is brief yet informative. While slightly longer due to 9 parameters, every sentence adds value and the structure helps with readability.

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?

For a mutation tool with 9 parameters and no annotations, the description provides good parameter semantics but lacks behavioral context. The existence of an output schema reduces the need to describe return values, but the description should still address authentication, error handling, and usage guidelines given the tool's complexity and mutation nature.

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?

With 0% schema description coverage and 9 parameters, the description provides comprehensive semantic explanations for all parameters. It clarifies ambiguous terms like 'content' vs 'description', explains numeric ranges for 'priority', provides format examples for 'due_string' and 'due_date', and clarifies relationships between parameters like 'project_id' and 'section_id'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Create a new task') and resource ('in Todoist'), distinguishing it from sibling tools like update_task, complete_task, or delete_task. It provides a verb+resource combination that leaves no ambiguity about the tool's function.

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 update_task or create_project. It doesn't mention prerequisites (e.g., needing valid project_id for certain use cases) or contextual factors that would help an agent choose between this and sibling tools.

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/dan-bailey/todoist-mcp'

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