hs_get_contact
Retrieve a contact by ID to access all standard properties, associated company, and deal IDs.
Instructions
Retrieve a single contact by ID with all standard properties and associated company/deal IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contactId | Yes | HubSpot contact ID |
Implementation Reference
- src/tools/contacts.ts:28-33 (handler)The actual handler function that executes the 'hs_get_contact' tool logic. Calls hubspot GET endpoint with contact ID, standard properties, and associated company/deal IDs.
export async function getContact(args: z.infer<typeof GetContactSchema>) { return hubspot(`/crm/v3/objects/contacts/${args.contactId}`, "GET", undefined, { properties: CONTACT_PROPS, associations: "companies,deals", }); } - src/tools/contacts.ts:24-26 (schema)Zod schema for the 'hs_get_contact' tool input validation. Defines the required 'contactId' parameter.
export const GetContactSchema = z.object({ contactId: z.string().describe("HubSpot contact ID"), }); - src/index.ts:89-94 (registration)Registration of the 'hs_get_contact' tool with the MCP server. Binds the name, description, schema, and handler.
server.tool( "hs_get_contact", "Retrieve a single contact by ID with all standard properties and associated company/deal IDs.", GetContactSchema.shape, async (args) => { try { return ok(await getContact(args)); } catch (e) { return err(e); } }, ); - src/index.ts:6-14 (registration)Import statement that brings the GetContactSchema and getContact function from src/tools/contacts.ts into the registration file.
// Contacts import { SearchContactsSchema, searchContacts, GetContactSchema, getContact, ContactByEmailSchema, contactByEmail, RecentContactsSchema, recentContacts, CreateContactSchema, createContact, UpdateContactSchema, updateContact, } from "./tools/contacts.js";