hs_list_owners
List HubSpot users eligible to own CRM records, optionally filtering by email to find a specific rep.
Instructions
List HubSpot users (owners) that can be assigned to CRM records. Filter by email to look up a specific rep.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Filter by owner email address | ||
| includeInactive | No |
Implementation Reference
- src/tools/owners.ts:9-14 (handler)The actual implementation of the 'hs_list_owners' tool handler. It calls the HubSpot API endpoint /crm/v3/owners with optional email and includeInactive parameters.
export async function listOwners(args: z.infer<typeof ListOwnersSchema>) { const params: Record<string, string | number | boolean> = {}; if (args.email) params.email = args.email; if (args.includeInactive) params.includeInactive = true; return hubspot("/crm/v3/owners", "GET", undefined, Object.keys(params).length ? params : undefined); } - src/tools/owners.ts:4-7 (schema)Zod schema for validating input arguments to hs_list_owners: optional email (string, email format) and optional includeInactive (boolean, defaults to false).
export const ListOwnersSchema = z.object({ email: z.string().email().optional().describe("Filter by owner email address"), includeInactive: z.boolean().default(false).optional(), }); - src/index.ts:296-301 (registration)Registration of the 'hs_list_owners' tool with the MCP server, wiring the schema and handler together.
server.tool( "hs_list_owners", "List HubSpot users (owners) that can be assigned to CRM records. Filter by email to look up a specific rep.", ListOwnersSchema.shape, async (args) => { try { return ok(await listOwners(args)); } catch (e) { return err(e); } }, ); - src/index.ts:71-71 (helper)Import statement that pulls in ListOwnersSchema and listOwners from the owners module.
import { ListOwnersSchema, listOwners } from "./tools/owners.js";