create_task
Generate and manage task entries by specifying a title, status, and assigned user on the MCP Test Server for streamlined task tracking and organization.
Instructions
Create a new task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignedTo | No | ID of user assigned to this task | |
| status | No | Task status | pending |
| title | Yes | Task title |
Implementation Reference
- src/domains/tasks.js:38-62 (handler)Executes the core logic for the 'create_task' tool: validates input, generates new task ID, adds to mock data store, returns success response with new task.static create(taskData) { const { title, status = 'pending', assignedTo } = taskData; if (!title) { return { success: false, message: 'Title is required' }; } const newTask = { id: Math.max(...tasks.map(t => t.id)) + 1, title, status, assignedTo: assignedTo || null }; tasks.push(newTask); return { success: true, message: 'Task created successfully', data: newTask }; }
- src/domains/tasks.js:133-156 (schema)Defines the input schema for the 'create_task' tool, including properties for title (required), status, and assignedTo.{ name: 'create_task', description: 'Create a new task', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Task title' }, status: { type: 'string', description: 'Task status', enum: ['pending', 'in-progress', 'completed'], default: 'pending' }, assignedTo: { type: 'number', description: 'ID of user assigned to this task' } }, required: ['title'] } },
- mcp-server.js:62-63 (registration)Registers and dispatches the 'create_task' tool call to TaskService.create within the MCP server's tool request handler.case 'create_task': return createMcpResponse(TaskService.create(args));