create_task
Create a new task in Autotask by specifying project ID, title, status, and optional details like description, assigned resource, and time estimates.
Instructions
Create a new task in Autotask
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectID | Yes | Project ID for the task | |
| title | Yes | Task title | |
| description | No | Task description | |
| status | Yes | Task status (1=New, 2=In Progress, 5=Complete) | |
| assignedResourceID | No | Assigned resource ID | |
| estimatedHours | No | Estimated hours for the task | |
| startDateTime | No | Task start date/time (ISO format) | |
| endDateTime | No | Task end date/time (ISO format) |
Implementation Reference
- Core handler function that performs the actual task creation using the Autotask API client.async createTask(task: Partial<AutotaskTask>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating task:', task); const result = await client.tasks.create(task as any); const taskId = (result.data as any)?.id; this.logger.info(`Task created with ID: ${taskId}`); return taskId; } catch (error) { this.logger.error('Failed to create task:', error); throw error; } }
- Input schema definition and tool metadata for the create_task tool, used for validation and documentation.{ name: 'create_task', description: 'Create a new task in Autotask', inputSchema: { type: 'object', properties: { projectID: { type: 'number', description: 'Project ID for the task' }, title: { type: 'string', description: 'Task title' }, description: { type: 'string', description: 'Task description' }, status: { type: 'number', description: 'Task status (1=New, 2=In Progress, 5=Complete)' }, assignedResourceID: { type: 'number', description: 'Assigned resource ID' }, estimatedHours: { type: 'number', description: 'Estimated hours for the task' }, startDateTime: { type: 'string', description: 'Task start date/time (ISO format)' }, endDateTime: { type: 'string', description: 'Task end date/time (ISO format)' } }, required: ['projectID', 'title', 'status'] } }
- src/handlers/tool.handler.ts:1051-1055 (registration)The listTools method registers the create_task tool by including it in the returned list of available MCP tools.]; this.logger.debug(`Listed ${tools.length} available tools`); return tools; }
- src/handlers/tool.handler.ts:1168-1171 (handler)Dispatch handler in callTool method that routes create_task calls to the autotaskService.createTask method.case 'create_task': result = await this.autotaskService.createTask(args); message = `Successfully created task with ID: ${result}`; break;