create_task_chain
Build a sequence of dependent tasks within ClickUp by specifying task details and a list ID. Automatically links tasks as dependencies to streamline project workflows.
Instructions
Create a chain of dependent tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto_link | No | Automatically link tasks as dependencies | |
| list_id | Yes | List ID for the tasks | |
| tasks | Yes | List of tasks to create in sequence |
Implementation Reference
- src/clickup_mcp/tools.py:1212-1249 (handler)The main handler function that creates a sequence of tasks in the specified list, optionally linking each subsequent task to the previous one as a dependency.async def create_task_chain( self, tasks: List[Dict[str, Any]], list_id: str, auto_link: bool = True, ) -> Dict[str, Any]: """Create a chain of dependent tasks.""" created_tasks = [] for i, task_data in enumerate(tasks): # Create task task_request = CreateTaskRequest( name=task_data["title"], description=task_data.get("description"), ) # Parse time estimate if provided if "time_estimate" in task_data: task_request.time_estimate = parse_duration(task_data["time_estimate"]) # Link to previous task if auto_link is enabled if auto_link and i > 0 and created_tasks: task_request.links_to = created_tasks[-1]["id"] task = await self.client.create_task(list_id, task_request) created_tasks.append( { "id": task.id, "name": task.name, "url": format_task_url(task.id), } ) return { "created": len(created_tasks), "tasks": created_tasks, "linked": auto_link, }
- src/clickup_mcp/tools.py:410-436 (schema)Defines the Tool schema including name, description, and inputSchema for validating parameters like tasks list, list_id, and auto_link option.Tool( name="create_task_chain", description="Create a chain of dependent tasks", inputSchema={ "type": "object", "properties": { "tasks": { "type": "array", "items": { "type": "object", "properties": { "title": {"type": "string"}, "description": {"type": "string"}, "time_estimate": {"type": "string"}, }, }, "description": "List of tasks to create in sequence", }, "list_id": {"type": "string", "description": "List ID for the tasks"}, "auto_link": { "type": "boolean", "description": "Automatically link tasks as dependencies", }, }, "required": ["tasks", "list_id"], }, ),
- src/clickup_mcp/tools.py:23-57 (registration)Registers 'create_task_chain' in the internal _tools dictionary, mapping the tool name to its handler method for dispatching.self._tools: Dict[str, Callable] = { "create_task": self.create_task, "get_task": self.get_task, "update_task": self.update_task, "delete_task": self.delete_task, "list_tasks": self.list_tasks, "search_tasks": self.search_tasks, "get_subtasks": self.get_subtasks, "get_task_comments": self.get_task_comments, "create_task_comment": self.create_task_comment, "get_task_status": self.get_task_status, "update_task_status": self.update_task_status, "get_assignees": self.get_assignees, "assign_task": self.assign_task, "list_spaces": self.list_spaces, "list_folders": self.list_folders, "list_lists": self.list_lists, "find_list_by_name": self.find_list_by_name, # Bulk operations "bulk_update_tasks": self.bulk_update_tasks, "bulk_move_tasks": self.bulk_move_tasks, # Time tracking "get_time_tracked": self.get_time_tracked, "log_time": self.log_time, # Templates "create_task_from_template": self.create_task_from_template, "create_task_chain": self.create_task_chain, # Analytics "get_team_workload": self.get_team_workload, "get_task_analytics": self.get_task_analytics, # User management "list_users": self.list_users, "get_current_user": self.get_current_user, "find_user_by_name": self.find_user_by_name, }
- src/clickup_mcp/server.py:41-45 (registration)MCP server registration of list_tools handler, which returns all tool definitions including create_task_chain schema.@self.server.list_tools() async def list_tools() -> List[Tool]: """List all available tools.""" return self.tools.get_tool_definitions()
- src/clickup_mcp/server.py:46-59 (registration)MCP server registration of call_tool handler, which dispatches to ClickUpTools.call_tool to execute create_task_chain based on name.@self.server.call_tool() async def call_tool( name: str, arguments: Optional[Dict[str, Any]] = None ) -> List[TextContent | ImageContent | EmbeddedResource]: """Call a specific tool.""" logger.debug(f"Calling tool: {name} with arguments: {arguments}") try: result = await self.tools.call_tool(name, arguments or {}) return [TextContent(type="text", text=result)] except Exception as e: logger.error(f"Error calling tool {name}: {e}", exc_info=True) return [TextContent(type="text", text=f"Error: {e!s}")]