create_project
Create a new project in Autotask by specifying company, name, status, dates, manager, and estimated hours to organize work and track progress.
Instructions
Create a new project in Autotask
Input Schema
TableJSON 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) | |
| projectManagerResourceID | No | Project manager resource ID | |
| estimatedHours | No | Estimated hours for the project |
Implementation Reference
- src/handlers/tool.handler.ts:406-447 (schema)Input schema definition for the create_project tool{ name: '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)' }, projectManagerResourceID: { type: 'number', description: 'Project manager resource ID' }, estimatedHours: { type: 'number', description: 'Estimated hours for the project' } }, required: ['companyID', 'projectName', 'status'] } },
- src/handlers/tool.handler.ts:1133-1136 (handler)Tool handler dispatch case for create_project, calling AutotaskService.createProjectcase 'create_project': result = await this.autotaskService.createProject(args); message = `Successfully created project with ID: ${result}`; break;
- Core helper function implementing project creation via Autotask API clientasync createProject(project: Partial<AutotaskProject>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating project:', project); const result = await client.projects.create(project as any); const projectId = (result.data as any)?.id; this.logger.info(`Project created with ID: ${projectId}`); return projectId; } catch (error) { this.logger.error('Failed to create project:', error); throw error; } }
- src/mcp/server.ts:97-110 (registration)MCP server registration for listing tools (includes create_project schema)// List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { try { this.logger.debug('Handling list tools request'); const tools = await this.toolHandler.listTools(); return { tools }; } catch (error) { this.logger.error('Failed to list tools:', error); throw new McpError( ErrorCode.InternalError, `Failed to list tools: ${error instanceof Error ? error.message : 'Unknown error'}` ); } });
- src/mcp/server.ts:112-131 (registration)MCP server registration for calling tools (executes create_project handler)// Call a tool this.server.setRequestHandler(CallToolRequestSchema, async (request) => { try { this.logger.debug(`Handling tool call: ${request.params.name}`); const result = await this.toolHandler.callTool( request.params.name, request.params.arguments || {} ); return { content: result.content, isError: result.isError }; } catch (error) { this.logger.error(`Failed to call tool ${request.params.name}:`, error); throw new McpError( ErrorCode.InternalError, `Failed to call tool: ${error instanceof Error ? error.message : 'Unknown error'}` ); } });