Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_recent_deals

Retrieve the most recently created deals from HubSpot CRM. Optionally exclude closed deals by setting openOnly to true. Configure the number of deals returned with the limit parameter.

Instructions

Most recently created deals. Pass openOnly=true to exclude closed deals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
openOnlyNoExclude closed deals

Implementation Reference

  • The actual handler function that executes the 'hs_recent_deals' tool logic. Calls the HubSpot API to search deals sorted by createdate descending, optionally filtering out closed deals.
    export async function recentDeals(args: z.infer<typeof RecentDealsSchema>) {
      const filters = args.openOnly
        ? [{ propertyName: "hs_is_closed", operator: "EQ", value: "false" }]
        : [];
      return hubspot("/crm/v3/objects/deals/search", "POST", {
        filterGroups: filters.length ? [{ filters }] : [],
        properties: DEAL_PROPS.split(","),
        sorts: [{ propertyName: "createdate", direction: "DESCENDING" }],
        limit: args.limit ?? 25,
      });
    }
  • Zod schema defining the input parameters for the recentDeals handler: limit (1-100, default 25) and openOnly (boolean, default false).
    export const RecentDealsSchema = z.object({
      limit: z.number().int().min(1).max(100).default(25).optional(),
      openOnly: z.boolean().default(false).optional().describe("Exclude closed deals"),
    });
  • src/index.ts:170-175 (registration)
    Registers 'hs_recent_deals' as an MCP tool on the server with its schema and a callback that invokes recentDeals().
    server.tool(
      "hs_recent_deals",
      "Most recently created deals. Pass openOnly=true to exclude closed deals.",
      RecentDealsSchema.shape,
      async (args) => { try { return ok(await recentDeals(args)); } catch (e) { return err(e); } },
    );
  • Shared DEAL_PROPS constant defining the properties fetched for all deal-related tools, including hs_recent_deals.
    const DEAL_PROPS = [
      "dealname", "amount", "dealstage", "pipeline", "closedate",
      "hubspot_owner_id", "hs_deal_stage_probability", "createdate",
      "hs_is_closed_won", "hs_is_closed", "associated_contact_ids",
    ].join(",");
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions filtering by openOnly but does not disclose order, pagination, time window for 'recent', rate limits, or whether it is read-only. The behavioral transparency is insufficient for a tool with no annotations.

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?

The description is extremely concise with two short sentences. The first sentence immediately conveys the core purpose, and the second sentence provides a key usage hint. No wasted 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 exists, so the description should explain return values or structure. It does not. Also lacks details on ordering, default limit behavior, or the definition of 'recent'. The description is incomplete for practical use.

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

Parameters2/5

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

Schema coverage is 50% (only openOnly has a description); the description paraphrases that parameter but adds no new meaning. The limit parameter is not described in either the schema or the description. The description fails to compensate for the low schema coverage.

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?

The description immediately states the tool retrieves 'Most recently created deals', which is a specific verb+resource. It distinguishes itself from sibling tools like hs_search_deals and hs_deals_by_stage by focusing on recency.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives such as hs_search_deals or hs_deals_by_stage. Does not explain prerequisites or scenarios where it is inappropriate.

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