create_task
Create new tasks with detailed specifications, complexity assessments, and completion criteria to manage and track work within the Task Manager system.
Instructions
Creates a new task that must be executed. If decomposing a complex task is required, must use 'decompose_task' first before executing it. All tasks start in the todo status. Must use 'update_task' before executing this task, and when executing this task has finished.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | A concise title for this task. Must be understandable out of context | |
| description | Yes | A detailed description of this task. Must be understandable out of context | |
| goal | Yes | The overall goal of this task. Must be understandable out of context | |
| criticalPath | Yes | Whether this task is on the critical path and required for completion | |
| definitionsOfDone | Yes | A detailed list of criteria that must be met for this task to be considered 'complete'. Must be understandable out of context. | |
| uncertaintyAreas | Yes | A detailed list of areas where there is uncertainty about this task's requirements or execution. Must be understandable out of context. May be empty. | |
| estimatedComplexity | Yes | An estimate of the complexity of this task. All tasks with complexity higher than low must be decomposed into smaller, more manageable subtasks before execution. Caution: Don't underestimate complexity. |
Implementation Reference
- tools/create_task.ts:33-90 (handler)The handler function that creates a new task object, stores it in the task database, optionally sets it as the current task for single-agent mode, computes incomplete tasks in the tree, and returns a CallToolResult with content (text warning if decomposition needed, resource link) and structured content with task info.export async function handleCreateTask( { title, description, goal, definitionsOfDone, criticalPath, uncertaintyAreas, estimatedComplexity }: CreateTaskArgs, taskDB: TaskDB, singleAgent: boolean ) { const task = { taskID: newTaskID(), status: TodoStatus, dependsOnTaskIDs: [], title, description, goal, definitionsOfDone, criticalPath: !!criticalPath, uncertaintyAreas, estimatedComplexity, lessonsLearned: [], verificationEvidence: [], } satisfies Task taskDB.set(task.taskID, task) if (singleAgent) { taskDB.setCurrentTask(task.taskID) } const incompleteTaskIDs = taskDB.incompleteTasksInTree(task.taskID).map((t) => t.taskID) const res = { taskCreated: toBasicTaskInfo(task, false, false, true), incompleteTasksIdealOrder: singleAgent ? incompleteTaskIDs : undefined, } return { content: [ mustDecompose(task) && ({ type: 'text', text: "Task must be decomposed before execution, use 'decompose_task' tool", audience: ['assistant'], } satisfies TextContent), { type: 'resource_link', uri: `task://${task.taskID}`, name: task.taskID, title: task.title, annotations: { audience: ['assistant'], priority: 1, }, } satisfies ResourceLink, ].filter(Boolean), structuredContent: res, } satisfies CallToolResult }
- tools/create_task.ts:15-17 (schema)Zod schema defining the input arguments for the create_task tool, extending SimpleTaskSchema with estimatedComplexity field.export const CreateTaskArgsSchema = SimpleTaskSchema.extend({ estimatedComplexity: TaskComplexitySchema, })
- tools/create_task.ts:23-31 (registration)Tool definition object createTaskTool used for listing tools (via tools() in index.ts), including name, title, description, and inputSchema derived from CreateTaskArgsSchema.export const createTaskTool = { name: CREATE_TASK, title: 'Create task', description: `Creates a new task that must be executed. If decomposing a complex task is required, must use 'decompose_task' first before executing it. All tasks start in the todo status. Must use 'update_task' before executing this task, and when executing this task has finished.`, inputSchema: zodToJsonSchema(CreateTaskArgsSchema, { $refStrategy: 'none' }), }
- tools/index.ts:24-27 (registration)Registration of the create_task tool handler and schema in the toolHandlers() map, used by task_manager.ts to dispatch tool calls.[CREATE_TASK]: { handler: handleCreateTask, schema: CreateTaskArgsSchema, } satisfies ToolHandlerInfo,
- tools/index.ts:14-19 (registration)The tools() function returns an array of tool objects including createTaskTool, used for the listTools MCP request.export function tools(singleAgent: boolean) { if (!singleAgent) { return [createTaskTool, decomposeTaskTool, updateTaskTool, taskInfoTool] as const } return [createTaskTool, decomposeTaskTool, updateTaskTool, taskInfoTool, currentTaskTool] as const