task_create
Create new tasks with titles, project assignments, and due dates to organize developer operational workflows and track progress efficiently.
Instructions
Создать новую задачу
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| due | No | Срок выполнения (YYYY-MM-DD) | |
| project | No | Проект | |
| title | Yes | Заголовок задачи |
Implementation Reference
- src/connectors/task-service.ts:20-44 (handler)Core implementation of task_create tool: loads tasks from Markdown file, creates new Task with auto ID, appends and saves.async createTask(title: string, project?: string, due?: string): Promise<Task> { try { console.log(`✅ Создание задачи: ${title}`); const tasks = await this.loadTasks(); const newTask: Task = { id: this.getNextId(tasks), title, project, due, created_at: new Date().toISOString(), }; tasks.push(newTask); await this.saveTasks(tasks); console.log(`✅ Задача создана: ${title} (ID: ${newTask.id})`); return newTask; } catch (error) { console.error('Ошибка создания задачи:', error); throw new Error(`Ошибка создания задачи: ${error}`); } }
- src/server.ts:133-154 (registration)Registers 'task_create' tool in MCP server's ListTools response, defining name, description, and input schema.{ name: 'task_create', description: 'Создать новую задачу', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Заголовок задачи', }, project: { type: 'string', description: 'Проект', }, due: { type: 'string', description: 'Срок выполнения (YYYY-MM-DD)', }, }, required: ['title'], }, },
- src/server.ts:210-213 (handler)MCP CallToolRequest handler switch case: extracts arguments and calls TaskService.createTask.case 'task_create': return { content: await this.taskService.createTask(args.title as string, args.project as string, args.due as string) };
- src/connectors/task-service.ts:4-11 (schema)TypeScript interface defining the Task structure used in createTask implementation.export interface Task { id: number; title: string; project?: string; due?: string; created_at: string; completed_at?: string; }
- Helper method to persist tasks to Markdown file, used by createTask.private async saveTasks(tasks: Task[]): Promise<void> { const content = this.generateMarkdownFromTasks(tasks); await fs.writeFile(this.tasksFile, content, 'utf-8'); }