create_new_task
Creates independent tasks for unrelated work, context switches, or parallel workstreams by adding new top-level tasks to your workspace while maintaining previous task status.
Instructions
Create an INDEPENDENT task for unrelated work. Use for: new topics, context switches, or parallel workstreams. Adds a new top-level task to your workspace. Previous task keeps its status. Example: working on Feature A, need to research Topic B → create_new_task for Topic B. For breaking down current work, use extend_current_task.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Brief task description (max 256 chars) | |
| body | Yes | Full task context, notes, and details |
Implementation Reference
- src/handlers.py:31-53 (handler)Main handler function that creates a new independent task by calling task_manager.create_new_task and returns task info and focus path.async def handle_create_new_task(self, title: str, body: str) -> Dict[str, Any]: try: # Get previous task info before creating new one previous_task = self.task_manager.current_task task = self.task_manager.create_new_task(title, body) response = { "task_id": task.id, "message": f"Created independent task: {task.title}", "focus_path": self.task_manager.get_focus_path(), "is_current": True, } if previous_task: response["note"] = ( f"Previous task '{previous_task.title}' is now pending" ) return response except ValueError as e: return {"error": str(e)}
- src/handlers.py:235-252 (schema)Tool schema definition including input schema requiring title and body.Tool( name="create_new_task", description="Create an INDEPENDENT task for unrelated work. Use for: new topics, context switches, or parallel workstreams. Adds a new top-level task to your workspace. Previous task keeps its status. Example: working on Feature A, need to research Topic B → create_new_task for Topic B. For breaking down current work, use extend_current_task.", inputSchema={ "type": "object", "properties": { "title": { "type": "string", "description": "Brief task description (max 256 chars)", }, "body": { "type": "string", "description": "Full task context, notes, and details", }, }, "required": ["title", "body"], }, ),
- src/server.py:49-51 (registration)Registration of the tool handler in the MCP server's call_tool handler_map."create_new_task": lambda: handlers.handle_create_new_task( arguments["title"], arguments["body"] ),
- src/task_manager.py:88-98 (helper)Core helper method in TaskManager that instantiates and appends a new MainTask to global_tasks, sets it as CURRENT, and pendings the previous current task.def create_new_task(self, title: str, body: str) -> MainTask: new_task = MainTask(title=title, body=body) new_task.status = TaskStatus.CURRENT if self.current_task: self.current_task.status = TaskStatus.PENDING self.global_tasks.append(new_task) self._manual_current_task = None # Clear manual focus return new_task