Skip to main content
Glama

hubspot_update_contact

Modify existing contact information in HubSpot CRM by updating specific properties using the contact ID.

Instructions

Update an existing contact in HubSpot (ignores if contact does not exist)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idYesHubSpot contact ID to update
propertiesYesContact properties to update

Implementation Reference

  • src/index.ts:186-204 (registration)
    Registration of the hubspot_update_contact tool including its name, description, and input schema in the MCP ListTools response.
    { name: 'hubspot_update_contact', description: 'Update an existing contact in HubSpot (ignores if contact does not exist)', inputSchema: { type: 'object', properties: { contact_id: { type: 'string', description: 'HubSpot contact ID to update' }, properties: { type: 'object', description: 'Contact properties to update', additionalProperties: true } }, required: ['contact_id', 'properties'] } },
  • MCP CallTool handler case for hubspot_update_contact that extracts arguments and delegates execution to HubSpotClient.updateContact method.
    case 'hubspot_update_contact': { const result = await this.hubspot.updateContact( args.contact_id as string, args.properties as Record<string, any> ); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Core handler implementation in HubSpotClient that verifies contact existence and performs the update via HubSpot CRM Contacts API, returning success/error details.
    async updateContact( contactId: string, properties: Record<string, any> ): Promise<any> { try { // Check if contact exists try { await this.client.crm.contacts.basicApi.getById(contactId); } catch (error: any) { // If contact doesn't exist, return a message if (error.statusCode === 404) { return { message: 'Contact not found, no update performed', contactId }; } // For other errors, throw them to be caught by the outer try/catch throw error; } // Update the contact const apiResponse = await this.client.crm.contacts.basicApi.update(contactId, { properties }); return { message: 'Contact updated successfully', contactId, properties }; } catch (error: any) { console.error('Error updating contact:', error); throw new Error(`HubSpot API error: ${error.message}`); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lkm1developer/hubspot-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server