update_company
Modify company details in Autotask including contact information, address, and active status to maintain accurate client records.
Instructions
Update an existing company in Autotask
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address1 | No | Company address line 1 | |
| city | No | Company city | |
| companyName | No | Company name | |
| id | Yes | Company ID to update | |
| isActive | No | Whether the company is active | |
| phone | No | Company phone number | |
| postalCode | No | Company postal/ZIP code | |
| state | No | Company state/province |
Implementation Reference
- src/services/autotask.service.ts:205-216 (handler)Core handler implementation: Updates a company using the AutotaskClient.accounts.update API method.async updateCompany(id: number, updates: Partial<AutotaskCompany>): Promise<void> { const client = await this.ensureClient(); try { this.logger.debug(`Updating company ${id}:`, updates); await client.accounts.update(id, updates as any); this.logger.info(`Company ${id} updated successfully`); } catch (error) { this.logger.error(`Failed to update company ${id}:`, error); throw error; } }
- src/handlers/tool.handler.ts:1086-1089 (handler)MCP tool dispatcher: Handles 'update_company' tool calls by delegating to AutotaskService.updateCompany.case 'update_company': result = await this.autotaskService.updateCompany(args.id, args); message = `Successfully updated company ID: ${args.id}`; break;
- src/handlers/tool.handler.ts:123-164 (schema)Tool schema definition: Specifies input parameters, description, and validation for the update_company tool, provided via listTools().{ name: 'update_company', description: 'Update an existing company in Autotask', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Company ID to update' }, companyName: { type: 'string', description: 'Company name' }, 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' }, isActive: { type: 'boolean', description: 'Whether the company is active' } }, required: ['id'] } },
- src/mcp/server.ts:98-110 (registration)MCP server registration: Registers the listTools handler which exposes the update_company tool schema to MCP clients.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'}` ); } });