Skip to main content
Glama

add_tasks_to_project

Add specific tasks, including titles, descriptions, and recommendations, to an existing project identified by its project ID.

Instructions

Add new tasks to an existing project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the project to add tasks to (e.g., proj-1).
tasksYesAn array of task objects to add.

Implementation Reference

  • The main handler (ToolExecutor) for the 'add_tasks_to_project' tool. Validates projectId and tasks array, then calls TaskManager.addTasksToProject. Registers itself in toolExecutorMap.
    const addTasksToProjectToolExecutor: ToolExecutor = { name: "add_tasks_to_project", async execute(taskManager, args) { // 1. Argument Validation const projectId = validateProjectId(args.projectId); const tasks = validateTaskObjects(args.tasks); // 2. Core Logic Execution const resultData = await taskManager.addTasksToProject(projectId, tasks); // 3. Return raw success data return resultData; }, }; toolExecutorMap.set(addTasksToProjectToolExecutor.name, addTasksToProjectToolExecutor);
  • MCP Tool definition with inputSchema, description, and name for 'add_tasks_to_project'.
    * @param {object} args - A JSON object containing the arguments * @see {addTasksToProjectToolExecutor} */ const addTasksToProjectTool: Tool = { name: "add_tasks_to_project", description: "Add new tasks to an existing project.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to add tasks to (e.g., proj-1).", }, tasks: { type: "array", description: "An array of task objects to add.", 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"], }, }, }, required: ["projectId", "tasks"], }, };
  • Registration of the 'add_tasks_to_project' tool (as addTasksToProjectTool) in the exported ALL_TOOLS array used for MCP tool exposure.
    export const ALL_TOOLS: Tool[] = [ listProjectsTool, readProjectTool, createProjectTool, deleteProjectTool, addTasksToProjectTool, finalizeProjectTool, generateProjectPlanTool, listTasksTool, readTaskTool, createTaskTool, updateTaskTool, deleteTaskTool, approveTaskTool, getNextTaskTool, ];
  • Core helper method in TaskManager that implements the logic to add tasks to a project: finds project, generates task IDs, initializes tasks, appends to project.tasks, saves to disk, returns added tasks info.
    public async addTasksToProject( projectId: string, tasks: { title: string; description: string; toolRecommendations?: string; ruleRecommendations?: string }[] ): Promise<AddTasksSuccessData> { await this.ensureInitialized(); await this.reloadFromDisk(); const proj = this.data.projects.find((p) => p.projectId === projectId); if (!proj) { throw new AppError(`Project ${projectId} not found`, AppErrorCode.ProjectNotFound); } if (proj.completed) { throw new AppError('Project is already completed', AppErrorCode.ProjectAlreadyCompleted); } const newTasks: Task[] = []; for (const taskDef of tasks) { this.taskCounter += 1; const newTask: Task = { id: `task-${this.taskCounter}`, title: taskDef.title, description: taskDef.description, status: "not started", approved: false, completedDetails: "", toolRecommendations: taskDef.toolRecommendations, ruleRecommendations: taskDef.ruleRecommendations, }; newTasks.push(newTask); proj.tasks.push(newTask); } await this.saveTasks(); return { newTasks: newTasks.map((t) => ({ id: t.id, title: t.title, description: t.description, })), message: `Added ${newTasks.length} tasks to project ${projectId}`, }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chriscarrollsmith/taskqueue-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server