create_task
Add a new task to a Yokan Board column with title, optional description, and due date to organize work items.
Instructions
Creates a new task in a specified column with optional description and due date.
Args: board_id (int): The ID of the board containing the column. column_id (str): The ID of the column to add the task to. title (str): The title of the new task. auth (AuthContext): The authentication context containing user ID and token. description (Optional[str], optional): The description of the task. Defaults to None. dueDate (Optional[str], optional): The due date of the task (e.g., "YYYY-MM-DD"). Defaults to None.
Returns: str: The ID of the newly created task.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| board_id | Yes | ||
| column_id | Yes | ||
| title | Yes | ||
| auth | Yes | ||
| description | No | ||
| dueDate | No |
Implementation Reference
- src/main.py:369-410 (handler)The `create_task` function is the handler for creating a new task. It updates the board data by adding a task to the specified column and triggers a board update via the `yokan_client`.
async def create_task( board_id: int, column_id: str, title: str, auth: AuthContext, description: Optional[str] = None, dueDate: Optional[str] = None, ) -> str: """Creates a new task in a specified column with optional description and due date. Args: board_id (int): The ID of the board containing the column. column_id (str): The ID of the column to add the task to. title (str): The title of the new task. auth (AuthContext): The authentication context containing user ID and token. description (Optional[str], optional): The description of the task. Defaults to None. dueDate (Optional[str], optional): The due date of the task (e.g., "YYYY-MM-DD"). Defaults to None. Returns: str: The ID of the newly created task. """ board = await yokan_client.get_board(board_id=board_id, token=auth.token) if "columns" not in board.data or column_id not in board.data["columns"]: raise McpError(error=ErrorData(code=NOT_FOUND, message="Column not found")) column = board.data["columns"][column_id] if "tasks" not in column: column["tasks"] = [] task_id = str(uuid.uuid4()) new_task = { "id": task_id, "content": title, "description": description, "dueDate": dueDate, } column["tasks"].append(new_task) await yokan_client.update_board( board_id=board_id, name=board.name, data=board.data, token=auth.token ) return task_id