create_project
Initiate a new project by defining an initial prompt and organizing tasks. Streamline workflows by setting task details, tool recommendations, and optional auto-approval settings for efficient task management.
Instructions
Create a new project with an initial prompt and a list of tasks. This is typically the first step in any workflow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autoApprove | No | If true, tasks will be automatically approved when marked as done. If false or not provided, tasks require manual approval. | |
| initialPrompt | Yes | The initial prompt or goal for the project. | |
| projectPlan | No | A more detailed plan for the project. If not provided, the initial prompt will be used. | |
| tasks | Yes | An array of task objects. |
Implementation Reference
- src/server/toolExecutors.ts:149-179 (handler)MCP tool handler/executor: validates inputs (initialPrompt, tasks, projectPlan, autoApprove) and calls TaskManager.createProject to create the project.const createProjectToolExecutor: ToolExecutor = { name: "create_project", async execute(taskManager, args) { const initialPrompt = validateRequiredStringParam(args.initialPrompt, "initialPrompt"); const validatedTasks = validateTaskObjects(args.tasks); const projectPlan = args.projectPlan !== undefined ? String(args.projectPlan) : undefined; const autoApprove = args.autoApprove as boolean | undefined; if (args.projectPlan !== undefined && typeof args.projectPlan !== 'string') { throw new AppError( "Invalid type for optional parameter 'projectPlan' (Expected string)", AppErrorCode.InvalidArgument ); } if (args.autoApprove !== undefined && typeof args.autoApprove !== 'boolean') { throw new AppError( "Invalid type for optional parameter 'autoApprove' (Expected boolean)", AppErrorCode.InvalidArgument ); } const resultData = await taskManager.createProject( initialPrompt, validatedTasks, projectPlan, autoApprove ); return resultData; }, };
- src/server/tools.ts:56-103 (schema)Tool definition with name, description, and detailed input schema for create_project.const createProjectTool: Tool = { name: "create_project", description: "Create a new project with an initial prompt and a list of tasks. This is typically the first step in any workflow.", inputSchema: { type: "object", properties: { initialPrompt: { type: "string", description: "The initial prompt or goal for the project.", }, projectPlan: { type: "string", description: "A more detailed plan for the project. If not provided, the initial prompt will be used.", }, tasks: { type: "array", description: "An array of task objects.", items: { type: "object", properties: { 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: ["title", "description"], }, }, autoApprove: { type: "boolean", description: "If true, tasks will be automatically approved when marked as done. If false or not provided, tasks require manual approval.", }, }, required: ["initialPrompt", "tasks"], }, };
- src/server/TaskManager.ts:105-154 (helper)Core logic: generates project/task IDs, initializes project data structure, persists to JSON file, returns success data.public async createProject( initialPrompt: string, tasks: { title: string; description: string; toolRecommendations?: string; ruleRecommendations?: string }[], projectPlan?: string, autoApprove?: boolean ): Promise<ProjectCreationSuccessData> { await this.ensureInitialized(); await this.reloadFromDisk(); this.projectCounter += 1; const projectId = `proj-${this.projectCounter}`; const newTasks: Task[] = []; for (const taskDef of tasks) { this.taskCounter += 1; newTasks.push({ id: `task-${this.taskCounter}`, title: taskDef.title, description: taskDef.description, status: "not started", approved: false, completedDetails: "", toolRecommendations: taskDef.toolRecommendations, ruleRecommendations: taskDef.ruleRecommendations, }); } const newProject: Project = { projectId, initialPrompt, projectPlan: projectPlan || initialPrompt, tasks: newTasks, completed: false, autoApprove: autoApprove === false ? false : true, }; this.data.projects.push(newProject); await this.saveTasks(); return { projectId, totalTasks: newTasks.length, tasks: newTasks.map((t) => ({ id: t.id, title: t.title, description: t.description, })), message: `Project ${projectId} created with ${newTasks.length} tasks.`, }; }
- src/server/toolExecutors.ts:180-180 (registration)Registers the create_project executor in the global toolExecutorMap used by executeToolAndHandleErrors.toolExecutorMap.set(createProjectToolExecutor.name, createProjectToolExecutor);
- src/server/tools.ts:432-448 (registration)Includes createProjectTool in the exported ALL_TOOLS array, used for MCP tools/listing.export const ALL_TOOLS: Tool[] = [ listProjectsTool, readProjectTool, createProjectTool, deleteProjectTool, addTasksToProjectTool, finalizeProjectTool, generateProjectPlanTool, listTasksTool, readTaskTool, createTaskTool, updateTaskTool, deleteTaskTool, approveTaskTool, getNextTaskTool, ];