Skip to main content
Glama
yokan-board
by yokan-board

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

TableJSON Schema
NameRequiredDescriptionDefault
board_idYes
column_idYes
titleYes
authYes
descriptionNo
dueDateNo

Implementation Reference

  • 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

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/yokan-board/yokan-board-mcp'

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