Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_search_deals

Search deals by name using full-text queries to find specific deals in HubSpot CRM.

Instructions

Full-text search across deals by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesFull-text search (deal name, etc.)
limitNo

Implementation Reference

  • The main handler function for hs_search_deals. Sends a POST request to HubSpot's /crm/v3/objects/deals/search with full-text query, limit, properties, and sort order.
    export async function searchDeals(args: z.infer<typeof SearchDealsSchema>) {
      return hubspot("/crm/v3/objects/deals/search", "POST", {
        query: args.query,
        limit: args.limit ?? 20,
        properties: DEAL_PROPS.split(","),
        sorts: [{ propertyName: "createdate", direction: "DESCENDING" }],
      });
    }
  • Zod schema defining the input parameters for hs_search_deals: query (string) and optional limit (integer, 1-100, default 20).
    export const SearchDealsSchema = z.object({
      query: z.string().describe("Full-text search (deal name, etc.)"),
      limit: z.number().int().min(1).max(100).default(20).optional(),
    });
  • src/index.ts:149-154 (registration)
    Registration of the hs_search_deals tool with the MCP server, linking the schema and handler.
    server.tool(
      "hs_search_deals",
      "Full-text search across deals by name.",
      SearchDealsSchema.shape,
      async (args) => { try { return ok(await searchDeals(args)); } catch (e) { return err(e); } },
    );
  • Helper constant defining the list of deal properties retrieved for any deal query, used by searchDeals and other deal handlers.
    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, and the description lacks behavioral details such as read-only nature, pagination, case sensitivity, or matching behavior. As a search tool, it should disclose these traits.

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

Conciseness4/5

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

The description is a single concise sentence that directly states the purpose. It is front-loaded and wastes no words, though it could be slightly more informative without losing conciseness.

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?

Given the low complexity (2 parameters, no output schema), the description is insufficient. It does not explain return format, pagination defaults, or any constraints beyond the schema. The agent lacks key context for correct invocation.

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?

The description adds minimal value beyond the schema: it specifies 'by name', but the schema already indicates 'deal name, etc.' The limit parameter has no description in schema or description. Schema coverage is 50%.

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

Purpose4/5

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

The description clearly states it performs full-text search across deals by name. This distinguishes it from sibling search tools like hs_search_companies and hs_search_contacts, though it could specify if additional fields are searched.

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 is provided on when to use this tool versus alternatives like hs_crm_search or hs_deals_by_stage. The description does not include any context about when not to use it.

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