Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_search_companies

Search companies by name, domain, or industry using full-text queries. Specify search terms and optional result limit to find relevant company records in HubSpot CRM.

Instructions

Full-text search across companies by name, domain, or industry.

Input Schema

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

Implementation Reference

  • The actual handler function for hs_search_companies. Calls hubspot('/crm/v3/objects/companies/search', 'POST') with the query, limit, and properties.
    export async function searchCompanies(args: z.infer<typeof SearchCompaniesSchema>) {
      return hubspot("/crm/v3/objects/companies/search", "POST", {
        query: args.query,
        limit: args.limit ?? 20,
        properties: COMPANY_PROPS.split(","),
        sorts: [{ propertyName: "createdate", direction: "DESCENDING" }],
      });
    }
  • Zod schema defining input validation for hs_search_companies: query (string) and limit (number, 1-100, default 20).
    export const SearchCompaniesSchema = z.object({
      query: z.string().describe("Full-text search (company name, domain, etc.)"),
      limit: z.number().int().min(1).max(100).default(20).optional(),
    });
  • src/index.ts:126-131 (registration)
    Registration of the 'hs_search_companies' tool with the MCP server, binding the schema and the searchCompanies handler.
    server.tool(
      "hs_search_companies",
      "Full-text search across companies by name, domain, or industry.",
      SearchCompaniesSchema.shape,
      async (args) => { try { return ok(await searchCompanies(args)); } catch (e) { return err(e); } },
    );
  • Constant list of company properties returned by the search.
    const COMPANY_PROPS = [
      "name", "domain", "industry", "numberofemployees", "annualrevenue",
      "city", "state", "country", "phone", "website",
      "hs_lead_status", "lifecyclestage", "createdate", "hubspot_owner_id",
    ].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 states it performs full-text search on certain fields but does not disclose behavioral traits such as pagination, ordering, rate limits, or whether results are partial. For a search tool, this is insufficient.

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 a single, concise sentence that front-loads the core action and scope. No extraneous information, every word earns its place.

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

Completeness4/5

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

For a simple search tool with two parameters, the description covers what is searched. However, it lacks output schema and does not mention return format or ordering. Given the low complexity, it is mostly complete but could include a note on result structure.

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?

The input schema has 100% description coverage (both 'query' and 'limit' are described). The description adds no additional semantic meaning beyond the schema, so baseline 3 is appropriate.

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 clearly states the verb 'search' and resource 'companies', specifying fields like name, domain, or industry. It naturally distinguishes from sibling tools such as hs_search_contacts and hs_search_deals.

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?

The description implies use for company search but provides no explicit guidance on when to use this tool versus alternative search tools (e.g., hs_crm_search, hs_get_company). No exclusions or prerequisites are mentioned.

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