create_new_task
Create independent tasks for unrelated work or context switches in your workspace. Use to manage parallel workstreams, new topics, or research without affecting current task status. Ideal for organizing complex workflows.
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 |
|---|---|---|---|
| body | Yes | Full task context, notes, and details | |
| title | Yes | Brief task description (max 256 chars) |
Implementation Reference
- src/handlers.py:31-53 (handler)The main handler function for the create_new_task tool. It delegates task creation to TaskManager and formats a response with task_id, message, focus_path, and note about previous task.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:236-252 (schema)Tool schema definition including name, description, and inputSchema for title and body parameters.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)Tool registration in the handler_map dictionary within the call_tool handler, mapping 'create_new_task' to a lambda invoking the handler with extracted arguments."create_new_task": lambda: handlers.handle_create_new_task( arguments["title"], arguments["body"] ),
- src/task_manager.py:88-97 (helper)Core helper method in TaskManager that creates and appends a new MainTask to global_tasks, sets its status to CURRENT, and updates previous current task to PENDING.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