autotask_update_contact
Update contact details in Autotask by specifying only the fields to change. Modify name, email, phone, address, or activity status.
Instructions
Update contact record. Only provided fields are changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Contact ID to update | |
| firstName | No | ||
| lastName | No | ||
| emailAddress | No | Primary email address | |
| phone | No | Primary phone number | |
| title | No | Job title | |
| isActive | No | Whether the contact is active | |
| mobilePhone | No | Mobile phone number | |
| addressLine | No | Address line (primary) | |
| addressLine1 | No | Address line 1 (secondary) | |
| city | No | City | |
| state | No | State/province | |
| zipCode | No | Postal/ZIP code | |
| countryID | No | Country ID (Autotask Countries entity) | |
| primaryContact | No | Whether this contact is the primary contact for their company |
Implementation Reference
- Schema definition for autotask_update_contact tool. Defines input schema with fields: id (required), firstName, lastName, emailAddress, phone, title, isActive, mobilePhone, addressLine, addressLine1, city, state, zipCode, countryID, primaryContact.
{ name: 'autotask_update_contact', description: 'Update contact record. Only provided fields are changed.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Contact ID to update' }, firstName: { type: 'string', }, lastName: { type: 'string', }, emailAddress: { type: 'string', description: 'Primary email address' }, phone: { type: 'string', description: 'Primary phone number' }, title: { type: 'string', description: 'Job title' }, isActive: { type: 'boolean', description: 'Whether the contact is active' }, mobilePhone: { type: 'string', description: 'Mobile phone number' }, addressLine: { type: 'string', description: 'Address line (primary)' }, addressLine1: { type: 'string', description: 'Address line 1 (secondary)' }, city: { type: 'string', description: 'City' }, state: { type: 'string', description: 'State/province' }, zipCode: { type: 'string', description: 'Postal/ZIP code' }, countryID: { type: 'number', description: 'Country ID (Autotask Countries entity)' }, primaryContact: { type: 'boolean', description: 'Whether this contact is the primary contact for their company' } }, required: ['id'] } }, - src/handlers/tool.handler.ts:803-805 (handler)Dispatch handler for autotask_update_contact. Calls s.updateContact(a.id, a) on the AutotaskService, passing the contact ID and all provided fields.
['autotask_update_contact', async (a) => { await s.updateContact(a.id, a); return { result: undefined, message: `Successfully updated contact ID: ${a.id}` }; }], - The updateContact method in AutotaskService. Calls http.update('Contacts', id, updates) to PATCH the Autotask API.
async updateContact(id: number, updates: Partial<AutotaskContact>): Promise<void> { const http = await this.ensureClient(); try { this.logger.debug(`Updating contact ${id}:`, updates); await http.update('Contacts', id, updates as Record<string, any>); this.logger.info(`Contact ${id} updated successfully`); } catch (error) { this.logger.error(`Failed to update contact ${id}:`, error); throw error; } }