create_company
Create a new company in Autotask by providing company details including name, type, contact information, and owner assignment to manage business relationships.
Instructions
Create a new company in Autotask
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address1 | No | Company address line 1 | |
| city | No | Company city | |
| companyName | Yes | Company name | |
| companyType | Yes | Company type ID | |
| isActive | No | Whether the company is active | |
| ownerResourceID | No | Owner resource ID | |
| phone | No | Company phone number | |
| postalCode | No | Company postal/ZIP code | |
| state | No | Company state/province |
Implementation Reference
- src/services/autotask.service.ts:190-202 (handler)Core handler implementation that creates a company via the Autotask API client.accounts.create() method.async createCompany(company: Partial<AutotaskCompany>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating company:', company); const result = await client.accounts.create(company as any); const companyId = (result.data as any)?.id; this.logger.info(`Company created with ID: ${companyId}`); return companyId; } catch (error) { this.logger.error('Failed to create company:', error); throw error; }
- src/handlers/tool.handler.ts:1081-1083 (handler)Dispatch handler in callTool switch statement that delegates to autotaskService.createCompany(args).case 'create_company': result = await this.autotaskService.createCompany(args); message = `Successfully created company with ID: ${result}`;
- src/handlers/tool.handler.ts:78-122 (registration)Tool registration definition in listTools() array, including name, description, and input schema.name: 'create_company', description: 'Create a new company in Autotask', inputSchema: { type: 'object', properties: { companyName: { type: 'string', description: 'Company name' }, companyType: { type: 'number', description: 'Company type ID' }, phone: { type: 'string', description: 'Company phone number' }, address1: { type: 'string', description: 'Company address line 1' }, city: { type: 'string', description: 'Company city' }, state: { type: 'string', description: 'Company state/province' }, postalCode: { type: 'string', description: 'Company postal/ZIP code' }, ownerResourceID: { type: 'number', description: 'Owner resource ID' }, isActive: { type: 'boolean', description: 'Whether the company is active' } }, required: ['companyName', 'companyType'] } },
- src/handlers/tool.handler.ts:80-122 (schema)Input schema definition for the create_company tool parameters and validation.inputSchema: { type: 'object', properties: { companyName: { type: 'string', description: 'Company name' }, companyType: { type: 'number', description: 'Company type ID' }, phone: { type: 'string', description: 'Company phone number' }, address1: { type: 'string', description: 'Company address line 1' }, city: { type: 'string', description: 'Company city' }, state: { type: 'string', description: 'Company state/province' }, postalCode: { type: 'string', description: 'Company postal/ZIP code' }, ownerResourceID: { type: 'number', description: 'Owner resource ID' }, isActive: { type: 'boolean', description: 'Whether the company is active' } }, required: ['companyName', 'companyType'] } },