Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_recent_contacts

Retrieve recently created HubSpot contacts, with optional filtering by lifecycle stage such as lead, marketingqualifiedlead, opportunity, or customer.

Instructions

Most recently created contacts, optionally filtered by lifecycle stage (lead, marketingqualifiedlead, opportunity, customer, etc.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
lifecycleStageNoFilter by lifecycle stage, e.g. 'lead', 'marketingqualifiedlead', 'opportunity', 'customer'

Implementation Reference

  • Zod schema for hs_recent_contacts input: optional limit (1-100, default 25) and optional lifecycleStage filter string.
    export const RecentContactsSchema = z.object({
      limit: z.number().int().min(1).max(100).default(25).optional(),
      lifecycleStage: z.string().optional().describe("Filter by lifecycle stage, e.g. 'lead', 'marketingqualifiedlead', 'opportunity', 'customer'"),
    });
  • Handler function recentContacts that calls HubSpot POST /crm/v3/objects/contacts/search with descending createdate sort, optional lifecycle stage filter, and configurable limit.
    export async function recentContacts(args: z.infer<typeof RecentContactsSchema>) {
      const body: Record<string, unknown> = {
        limit: args.limit ?? 25,
        properties: CONTACT_PROPS.split(","),
        sorts: [{ propertyName: "createdate", direction: "DESCENDING" }],
      };
      if (args.lifecycleStage) {
        body.filterGroups = [{
          filters: [{ propertyName: "lifecyclestage", operator: "EQ", value: args.lifecycleStage }],
        }];
      }
      return hubspot("/crm/v3/objects/contacts/search", "POST", body);
    }
  • src/index.ts:103-108 (registration)
    Registration of the hs_recent_contacts tool on the MCP server using RecentContactsSchema.shape and the recentContacts handler.
    server.tool(
      "hs_recent_contacts",
      "Most recently created contacts, optionally filtered by lifecycle stage (lead, marketingqualifiedlead, opportunity, customer, etc.).",
      RecentContactsSchema.shape,
      async (args) => { try { return ok(await recentContacts(args)); } catch (e) { return err(e); } },
    );
  • src/index.ts:11-14 (registration)
    Import of RecentContactsSchema and recentContacts from src/tools/contacts.ts into the main server file.
      RecentContactsSchema, recentContacts,
      CreateContactSchema, createContact,
      UpdateContactSchema, updateContact,
    } from "./tools/contacts.js";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description lacks details on pagination, ordering, scope (e.g., 'visible to user'), or what 'recent' means. Insufficient for a list tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise, single sentence, front-loaded with core purpose. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema; description does not specify returned fields or structure. Incomplete for a list endpoint.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description mentions lifecycleStage, which is also described in schema. No mention of limit parameter. Schema coverage is 50%, description adds minimal value beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it returns recently created contacts with optional lifecycle stage filtering. Distinct from siblings like hs_get_contact (single contact by ID) and hs_search_contacts (search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage for listing recent contacts, but no explicit guidance on when to use vs alternatives like hs_contact_by_email or hs_get_contact.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ZLeventer/hubspot-mcp'

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