hs_update_contact
Update one or more properties on an existing contact in HubSpot CRM by specifying the contact ID and property values.
Instructions
Update one or more properties on an existing contact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contactId | Yes | HubSpot contact ID | |
| properties | Yes | Properties to update, e.g. { jobtitle: 'VP Marketing' } |
Implementation Reference
- src/tools/contacts.ts:92-96 (handler)The actual handler function that executes the update contact logic. Makes a PATCH request to HubSpot CRM API /crm/v3/objects/contacts/{contactId} with the provided properties.
export async function updateContact(args: z.infer<typeof UpdateContactSchema>) { return hubspot(`/crm/v3/objects/contacts/${args.contactId}`, "PATCH", { properties: args.properties, }); } - src/tools/contacts.ts:87-90 (schema)Zod schema defining input validation for hs_update_contact: requires contactId (string) and properties (record of strings).
export const UpdateContactSchema = z.object({ contactId: z.string().describe("HubSpot contact ID"), properties: z.record(z.string()).describe("Properties to update, e.g. { jobtitle: 'VP Marketing' }"), }); - src/index.ts:117-122 (registration)Tool registration on the MCP server with name 'hs_update_contact', description, schema, and handler binding.
server.tool( "hs_update_contact", "Update one or more properties on an existing contact.", UpdateContactSchema.shape, async (args) => { try { return ok(await updateContact(args)); } catch (e) { return err(e); } }, ); - src/index.ts:13-14 (registration)Import of UpdateContactSchema and updateContact from tools/contacts module.
UpdateContactSchema, updateContact, } from "./tools/contacts.js";