create_task
Generate and manage tasks on the MCP Orchestrator Server by defining unique IDs, descriptions, and task dependencies for efficient task orchestration.
Instructions
Create a new task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dependencies | No | IDs of tasks that must be completed first | |
| description | Yes | Description of the task | |
| id | Yes | Unique identifier for the task |
Implementation Reference
- src/index.ts:90-129 (handler)Executes the create_task tool: extracts arguments, validates task ID uniqueness and dependencies, creates and persists the task to JSON file, returns task details.case "create_task": { const { id, description, dependencies } = request.params.arguments as { id: string; description: string; dependencies?: string[]; }; debug(`Creating task ${id}: ${description}`); if (tasks[id]) { throw new McpError(ErrorCode.InvalidRequest, `Task ${id} already exists`); } // Verify dependencies exist if (dependencies) { for (const depId of dependencies) { if (!tasks[depId]) { throw new McpError(ErrorCode.InvalidRequest, `Dependency task ${depId} not found`); } } } const task: Task = { id, description, status: 'pending', dependencies }; tasks[id] = task; saveTasks(); debug(`Created task ${id}`); return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }] }; }
- src/index.ts:339-361 (schema)Defines the tool metadata including name, description, and input schema for validation in ListTools response.name: "create_task", description: "Create a new task", inputSchema: { type: "object", properties: { id: { type: "string", description: "Unique identifier for the task" }, description: { type: "string", description: "Description of the task" }, dependencies: { type: "array", items: { type: "string" }, description: "IDs of tasks that must be completed first" } }, required: ["id", "description"] }
- src/index.ts:21-28 (schema)TypeScript interface defining the structure of a Task object used by create_task and other tools.interface Task { id: string; description: string; status: 'pending' | 'in_progress' | 'completed'; assignedTo?: string; result?: string; dependencies?: string[]; }