create-task
Add new todo tasks to your Kanban board by specifying a title and description for organized project management.
Instructions
create a new todo task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_title | Yes | ||
| description | Yes |
Implementation Reference
- src/index.ts:41-74 (registration)Registration of the 'create-task' MCP tool, including name, description, Zod input schema, metadata hints, and inline handler function that delegates to mongooseUtils.createTask.server.tool( "create-task", "create a new todo task", { task_title: z.string(), description: z.string(), }, { title: "create a todo task", readonlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, async (params) => { try { await mongooseUtils.createTask(params); return { content: [ { type: "text", text: `Task "${params.task_title}" created successfully!`, }, ], }; } catch { return { content: [ { type: "text", text: "An error occurred while creating the task." }, ], }; } } );
- src/index.ts:55-73 (handler)Inline handler function for the 'create-task' tool. It calls the createTask utility, returns a success message with task title, or error message on failure.async (params) => { try { await mongooseUtils.createTask(params); return { content: [ { type: "text", text: `Task "${params.task_title}" created successfully!`, }, ], }; } catch { return { content: [ { type: "text", text: "An error occurred while creating the task." }, ], }; } }
- src/index.ts:44-47 (schema)Zod input schema for the 'create-task' tool defining required string parameters: task_title and description.{ task_title: z.string(), description: z.string(), },
- src/utils/mongoose.ts:24-47 (helper)Helper utility function createTask that creates a new MongoDB Task document with default 'todo' status and associates it with the current user.export interface CreateTaskParams { task_title: string; description: string; } export async function createTask(params: CreateTaskParams): Promise<void> { const newTask = await Task.create({ title: params.task_title, description: params.description, taskStatus: "todo", }); // You may need to adjust how you get the user const user = await User.findOne({ username: username, }); if (user) { newTask.user = user; await newTask.save(); user.tasks.push(newTask); await user.save(); } }