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

move_task

Move tasks between columns on a Yokan Kanban board to update workflow status and organize project progress.

Instructions

Moves a task from one column to another.

Args: board_id (int): The ID of the board containing the task. task_id (str): The ID of the task to move. new_column_id (str): The ID of the destination column. auth (AuthContext): The authentication context containing user ID and token.

Returns: None

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
board_idYes
task_idYes
new_column_idYes
authYes

Implementation Reference

  • The `move_task` function, decorated with `@app_instance.tool`, implements the logic to move a task from one column to another on a Kanban board. It validates inputs, removes the task from its original column, appends it to the new column, and updates the board via the YokanClient.
    async def move_task(
        board_id: int,
        task_id: str,
        new_column_id: str,
        auth: AuthContext,
    ) -> None:
        """Moves a task from one column to another.
    
        Args:
            board_id (int): The ID of the board containing the task.
            task_id (str): The ID of the task to move.
            new_column_id (str): The ID of the destination column.
            auth (AuthContext): The authentication context containing user ID and token.
    
        Returns:
            None
        """
        board = await yokan_client.get_board(board_id=board_id, token=auth.token)
        if "columns" not in board.data or new_column_id not in board.data["columns"]:
            raise McpError(error=ErrorData(code=NOT_FOUND, message="New column not found"))
    
        task_to_move = None
        for column in board.data["columns"].values():
            for i, task in enumerate(column.get("tasks", [])):
                if task.get("id") == task_id:
                    task_to_move = column["tasks"].pop(i)
                    break
            if task_to_move:
                break
    
        if not task_to_move:
            raise McpError(error=ErrorData(code=NOT_FOUND, message="Task not found"))
    
        board.data["columns"][new_column_id].setdefault("tasks", []).append(task_to_move)
    
        await yokan_client.update_board(
            board_id=board_id, name=board.name, data=board.data, token=auth.token
        )

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