add-tag
Add tags to Kanban tasks to organize and categorize work items for better workflow management and tracking.
Instructions
add tags to a tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_tag | Yes | ||
| task_id | Yes |
Implementation Reference
- src/index.ts:169-193 (registration)Registration of the 'add-tag' MCP tool. Includes input schema (task_id: string, task_tag: string), inline handler that calls addTaskTag utility and returns success/error message.server.tool("add-tag", "add tags to a tasks",{ task_tag: z.string(), task_id: z.string() },async (params)=>{ try { await mongooseUtils.addTaskTag(params.task_id,params.task_tag); return{ content: [ { type: "text", text: `Added tag "${params.task_tag}" to tasks"${params.task_id}" successfully.`, }, ], } } catch { return{ content: [ { type: "text", text: `Failed to add tag "${params.task_tag}" to tasks"${params.task_id}".`, }, ], } } });
- src/utils/mongoose.ts:91-105 (helper)Core implementation of adding a tag to a task. Finds task by ID, adds lowercase tag if not already present, and persists to MongoDB.export async function addTaskTag(taskId: string, tag: string) { try { const task = await Task.findById(taskId); if (!task) { throw new Error("Task not found"); } if (!task.tags.includes(tag.toLowerCase())) { task.tags.push(tag.toLowerCase()); await task.save(); } } catch { throw new Error("Failed to add tag"); } }