create_company
Add new client companies to Autotask PSA with essential details like name, type, contact information, and owner assignment for streamlined customer management.
Instructions
Create a new company in Autotask
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyName | Yes | Company name | |
| companyType | Yes | Company type ID | |
| phone | No | Company phone number | |
| address1 | No | Company address line 1 | |
| city | No | Company city | |
| state | No | Company state/province | |
| postalCode | No | Company postal/ZIP code | |
| ownerResourceID | No | Owner resource ID | |
| isActive | No | Whether the company is active |
Implementation Reference
- src/services/autotask.service.ts:190-203 (handler)Core handler implementation that executes the company creation by calling 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-1084 (handler)MCP tool dispatcher that handles 'create_company' tool calls by delegating to AutotaskService.createCompany().case 'create_company': result = await this.autotaskService.createCompany(args); message = `Successfully created company with ID: ${result}`; break;
- src/handlers/tool.handler.ts:77-122 (schema)Tool schema definition including inputSchema, properties, required fields, and description. Returned by listTools() for MCP tool registration.{ 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/mcp/server.ts:98-111 (registration)MCP server registration of the listTools handler which exposes the create_company tool schema.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'}` ); } });