create_task
Add a new task to a project in Helios-9 MCP Server by specifying title, priority, due date, and assignee for project management.
Instructions
Create a new task in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID where the task will be created | |
| initiative_id | No | Optional initiative ID to associate the task with | |
| title | Yes | The title of the task | |
| description | No | Optional detailed description of the task | |
| priority | No | Priority level of the task | medium |
| due_date | No | Optional due date for the task (ISO 8601 format) | |
| assignee_id | No | Optional user ID to assign the task to |
Implementation Reference
- src/tools/tasks.ts:171-198 (handler)Main execution handler for 'create_task' MCP tool. Validates input with Zod schema, logs activity, calls supabaseService.createTask to persist the task, and returns the created task with a success message.export const createTask = requireAuth(async (args: any) => { const taskData = CreateTaskSchema.parse(args) logger.info('Creating new task', { project_id: taskData.project_id, initiative_id: taskData.initiative_id, title: taskData.title }) const task = await supabaseService.createTask({ project_id: taskData.project_id, initiative_id: taskData.initiative_id || null, title: taskData.title, description: taskData.description || null, priority: taskData.priority, due_date: taskData.due_date || null, assignee_id: taskData.assignee_id || null, status: 'todo' // Removed metadata as it doesn't exist in the database schema }) logger.info('Task created successfully', { task_id: task.id, title: task.title }) return { task, message: `Task "${task.title}" created successfully` } })
- src/tools/tasks.ts:123-169 (registration)MCPTool registration object defining the 'create_task' tool with name, description, and JSON input schema for MCP protocol compliance.export const createTaskTool: MCPTool = { name: 'create_task', description: 'Create a new task in a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', format: 'uuid', description: 'The project ID where the task will be created' }, initiative_id: { type: 'string', format: 'uuid', description: 'Optional initiative ID to associate the task with' }, title: { type: 'string', minLength: 1, maxLength: 500, description: 'The title of the task' }, description: { type: 'string', description: 'Optional detailed description of the task' }, priority: { type: 'string', enum: ['low', 'medium', 'high'], default: 'medium', description: 'Priority level of the task' }, due_date: { type: 'string', format: 'date-time', description: 'Optional due date for the task (ISO 8601 format)' }, assignee_id: { type: 'string', format: 'uuid', description: 'Optional user ID to assign the task to' }, // Removed metadata as it doesn't exist in the database schema }, required: ['project_id', 'title'] } }
- src/tools/tasks.ts:26-35 (schema)Zod validation schema used in the handler to parse and validate input arguments for creating a task.const CreateTaskSchema = z.object({ project_id: z.string().uuid(), initiative_id: z.string().uuid().optional(), title: z.string().min(1).max(500), description: z.string().optional(), priority: z.enum(['low', 'medium', 'high']).default('medium'), due_date: z.string().datetime().optional(), assignee_id: z.string().uuid().optional() // Removed metadata as it doesn't exist in the database schema })
- src/tools/tasks.ts:1157-1167 (registration)Central handlers map registering 'create_task' handler function for use in MCP tool server dispatching.export const taskHandlers = { list_tasks: listTasks, create_task: createTask, get_task: getTask, update_task: updateTask, add_task_dependency: addTaskDependency, get_task_dependencies: getTaskDependencies, create_task_workflow: createTaskWorkflow, bulk_update_tasks: bulkUpdateTasks, get_task_workflow_status: getTaskWorkflowStatus }
- src/lib/api-client.ts:427-434 (helper)API client helper method called by the tool handler to create the task via POST to /api/mcp/tasks endpoint.async createTask(taskData: TaskInsert): Promise<Task> { const response = await this.request<{ task: Task }>('/api/mcp/tasks', { method: 'POST', body: JSON.stringify(taskData), }) return response.task }