create_task
Add a new task to a project by specifying its title and description. Include optional tool and rule recommendations to streamline task execution and ensure alignment with guidelines.
Instructions
Create a new task within an existing project. You can optionally include tool and rule recommendations to guide task completion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | A detailed description of the task. | |
| projectId | Yes | The ID of the project to add the task to (e.g., proj-1). | |
| ruleRecommendations | No | Recommendations for relevant rules to review when completing the task. | |
| title | Yes | The title of the task. | |
| toolRecommendations | No | Recommendations for tools to use to complete the task. |
Implementation Reference
- src/server/toolExecutors.ts:436-467 (handler)The main handler (ToolExecutor) for the 'create_task' tool. Validates input parameters (projectId, title, description, optional recommendations), constructs a single task object, and delegates to taskManager.addTasksToProject() to create the task.const createTaskToolExecutor: ToolExecutor = { name: "create_task", async execute(taskManager, args) { const projectId = validateProjectId(args.projectId); const title = validateRequiredStringParam(args.title, "title"); const description = validateRequiredStringParam(args.description, "description"); if (args.toolRecommendations !== undefined && typeof args.toolRecommendations !== "string") { throw new AppError( "Invalid type for optional parameter 'toolRecommendations' (Expected string)", AppErrorCode.InvalidArgument ); } if (args.ruleRecommendations !== undefined && typeof args.ruleRecommendations !== "string") { throw new AppError( "Invalid type for optional parameter 'ruleRecommendations' (Expected string)", AppErrorCode.InvalidArgument ); } const singleTask = { title, description, toolRecommendations: args.toolRecommendations ? String(args.toolRecommendations) : undefined, ruleRecommendations: args.ruleRecommendations ? String(args.ruleRecommendations) : undefined, }; const resultData = await taskManager.addTasksToProject(projectId, [singleTask]); return resultData; }, }; toolExecutorMap.set(createTaskToolExecutor.name, createTaskToolExecutor);
- src/server/tools.ts:283-312 (schema)The Tool object definition for 'create_task', including name, description, and inputSchema for validation in MCP.const createTaskTool: Tool = { name: "create_task", description: "Create a new task within an existing project. You can optionally include tool and rule recommendations to guide task completion.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to add the task to (e.g., proj-1).", }, title: { type: "string", description: "The title of the task.", }, description: { type: "string", description: "A detailed description of the task.", }, toolRecommendations: { type: "string", description: "Recommendations for tools to use to complete the task.", }, ruleRecommendations: { type: "string", description: "Recommendations for relevant rules to review when completing the task.", } }, required: ["projectId", "title", "description"] } };
- src/server/toolExecutors.ts:467-467 (registration)Registers the createTaskToolExecutor in the toolExecutorMap used by the executeToolAndHandleErrors function.toolExecutorMap.set(createTaskToolExecutor.name, createTaskToolExecutor);
- src/server/tools.ts:432-448 (registration)Exports ALL_TOOLS array which includes the createTaskTool, likely used for MCP tool registration.export const ALL_TOOLS: Tool[] = [ listProjectsTool, readProjectTool, createProjectTool, deleteProjectTool, addTasksToProjectTool, finalizeProjectTool, generateProjectPlanTool, listTasksTool, readTaskTool, createTaskTool, updateTaskTool, deleteTaskTool, approveTaskTool, getNextTaskTool, ];