autotask_update_contact
Update a contact record by providing only the fields to change.
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
- src/handlers/tool.definitions.ts:338-407 (registration)Schema definition and registration of the 'autotask_update_contact' MCP tool. Defines all input properties (id required, plus optional fields like 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)Handler dispatch entry for 'autotask_update_contact'. Calls AutotaskService.updateContact with the contact id and all args, then returns a success message.
['autotask_update_contact', async (a) => { await s.updateContact(a.id, a); return { result: undefined, message: `Successfully updated contact ID: ${a.id}` }; }], - Service layer method that performs the actual Autotask API PATCH call via http.update('Contacts', id, updates) to update a contact record.
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; } } - src/types/autotask.ts:23-35 (schema)Type definition for AutotaskContact, representing the data shape used by the update operation.
export interface AutotaskContact { id?: number; companyID?: number; firstName?: string; lastName?: string; emailAddress?: string; phone?: string; title?: string; isActive?: number; // Note: autotask-node uses number, not boolean createDate?: string; lastModifiedDate?: string; [key: string]: any; }