autotask_create_project
Create a new project in Autotask by specifying company, name, status, and project type. Optionally add description, dates, hours, and project lead.
Instructions
Create a new project in Autotask
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyID | Yes | Company ID for the project | |
| projectName | Yes | Project name | |
| description | No | Project description | |
| status | Yes | Project status (1=New, 2=In Progress, 5=Complete) | |
| startDate | No | Project start date (YYYY-MM-DD) | |
| endDate | No | Project end date (YYYY-MM-DD) | |
| projectLeadResourceID | No | Project manager resource ID | |
| estimatedHours | No | Estimated hours for the project | |
| projectType | Yes | Project type (2=Proposal, 3=Template, 4=Internal, 5=Client, 8=Baseline). Required. |
Implementation Reference
- Schema definition for the 'autotask_create_project' tool. Defines input parameters: companyID, projectName, description, status, startDate, endDate, projectLeadResourceID, estimatedHours, projectType. Required fields: companyID, projectName, status, projectType.
{ name: 'autotask_create_project', description: 'Create a new project in Autotask', inputSchema: { type: 'object', properties: { companyID: { type: 'number', description: 'Company ID for the project' }, projectName: { type: 'string', description: 'Project name' }, description: { type: 'string', description: 'Project description' }, status: { type: 'number', description: 'Project status (1=New, 2=In Progress, 5=Complete)' }, startDate: { type: 'string', description: 'Project start date (YYYY-MM-DD)' }, endDate: { type: 'string', description: 'Project end date (YYYY-MM-DD)' }, projectLeadResourceID: { type: 'number', description: 'Project manager resource ID' }, estimatedHours: { type: 'number', description: 'Estimated hours for the project' }, projectType: { type: 'number', description: 'Project type (2=Proposal, 3=Template, 4=Internal, 5=Client, 8=Baseline). Required.' } }, required: ['companyID', 'projectName', 'status', 'projectType'] } }, - src/handlers/tool.handler.ts:963-975 (handler)Handler implementation for 'autotask_create_project'. Maps startDate/endDate (YYYY-MM-DD) to startDateTime/endDateTime (ISO format), then delegates to autotaskService.createProject().
['autotask_create_project', async (a) => { const projectData = { ...a }; // Map startDate/endDate (YYYY-MM-DD) to startDateTime/endDateTime (ISO) expected by the API if (projectData.startDate && !projectData.startDateTime) { projectData.startDateTime = `${projectData.startDate}T00:00:00Z`; delete projectData.startDate; } if (projectData.endDate && !projectData.endDateTime) { projectData.endDateTime = `${projectData.endDate}T00:00:00Z`; delete projectData.endDate; } const id = await s.createProject(projectData); return { result: id, message: `Successfully created project with ID: ${id}` }; }], - Service-layer createProject method. Calls AutotaskHttpClient.create('Projects', project) to POST to the Autotask REST API /Projects endpoint. Returns the new project ID.
async createProject(project: Partial<AutotaskProject>): Promise<number> { const http = await this.ensureClient(); try { this.logger.debug('Creating project:', project); const id = await http.create('Projects', project); this.logger.info(`Project created with ID: ${id}`); return id; } catch (error) { this.logger.error('Failed to create project:', error); throw error; } } - src/handlers/tool.handler.ts:764-766 (registration)Registration of 'autotask_create_project' in the dispatch table (getDispatchTable method). Maps the tool name string to its async handler function.
private getDispatchTable(): Map<string, (args: any) => Promise<{ result: any; message: string }>> { const s = this.autotaskService; type H = (args: any) => Promise<{ result: any; message: string }>;