Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_list_company_contacts

Retrieve all contacts belonging to a specific company in HubSpot. Input the company ID and optionally limit results up to 100. Ideal for viewing or exporting company-contact relationships.

Instructions

List all contacts associated with a company.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdYesHubSpot company ID
limitNo

Implementation Reference

  • The main handler function that executes the tool logic. It fetches associated contact IDs for a company and then retrieves full contact details in a batch read.
    export async function listCompanyContacts(args: z.infer<typeof ListCompanyContactsSchema>) {
      const assoc = await hubspot<{ results: Array<{ id: string }> }>(
        `/crm/v3/objects/companies/${args.companyId}/associations/contacts`,
        "GET",
        undefined,
        { limit: args.limit ?? 20 },
      );
      const ids = assoc.results.map((r) => r.id);
      if (!ids.length) return { results: [] };
      return hubspot("/crm/v3/objects/contacts/batch/read", "POST", {
        inputs: ids.map((id) => ({ id })),
        properties: ["firstname", "lastname", "email", "jobtitle", "phone", "lifecyclestage"],
      });
    }
  • Zod schema defining the input validation for the tool: companyId (string) and optional limit (1-100, default 20).
    export const ListCompanyContactsSchema = z.object({
      companyId: z.string().describe("HubSpot company ID"),
      limit: z.number().int().min(1).max(100).default(20).optional(),
    });
  • src/index.ts:140-145 (registration)
    Registration of the tool on the MCP server with name 'hs_list_company_contacts', description, schema, and handler binding.
    server.tool(
      "hs_list_company_contacts",
      "List all contacts associated with a company.",
      ListCompanyContactsSchema.shape,
      async (args) => { try { return ok(await listCompanyContacts(args)); } catch (e) { return err(e); } },
    );
  • src/index.ts:20-21 (registration)
    Import statement that brings in the schema and handler from the companies module.
      ListCompanyContactsSchema, listCompanyContacts,
    } from "./tools/companies.js";
Behavior2/5

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

With no annotations, the description carries the full burden but only states a basic read operation. It fails to disclose ordering, pagination behavior, side effects, or any constraints. As a minimal description, it adds little beyond the name.

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

Conciseness3/5

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

The description is concise (one sentence) but lacks structure. It is front-loaded with purpose but misses the opportunity to present additional context efficiently. Could be improved with bullet points or a more informative single sentence.

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 means the return format is completely unspecified. The description does not hint at what fields are returned, error conditions, or pagination handling. For a simple tool, this is a significant gap given no other documentation.

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% (companyId described, limit not). The description does not mention the limit parameter or its default/range, leaving the agent to infer from the schema alone. No additional semantic value is provided.

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 specifies the action (list) and resource (contacts) within a context (associated with a company), which distinguishes it from sibling tools like hs_search_contacts or hs_get_contact.

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 such as hs_search_contacts or hs_recent_contacts. The description lacks context about prerequisites, exclusions, or typical use cases.

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