Skip to main content
Glama

hubspot_get_contact

Retrieve specific contact details from HubSpot CRM using a contact ID to access customer information and properties for sales analysis.

Instructions

Get a specific contact by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesThe ID of the contact to retrieve
propertiesNoList of properties to include in the results

Implementation Reference

  • Core implementation of the tool logic: retrieves a specific contact by ID from HubSpot CRM using the API client.
    async getContact(contactId: string, properties?: string[]): Promise<any> {
      return await this.client.crm.contacts.basicApi.getById(contactId, properties || ["email", "firstname", "lastname", "phone"]);
    }
  • Tool definition including name, description, and input schema validation for 'hubspot_get_contact'.
    const getContactTool: Tool = {
      name: "hubspot_get_contact",
      description: "Get a specific contact by ID",
      inputSchema: {
        type: "object",
        properties: {
          contactId: {
            type: "string",
            description: "The ID of the contact to retrieve",
          },
          properties: {
            type: "array",
            items: {
              type: "string",
            },
            description: "List of properties to include in the results",
          },
        },
        required: ["contactId"],
      },
    };
  • Request handler case that parses arguments, validates input, calls the core getContact method, and formats the response for MCP.
    case "hubspot_get_contact": {
      const args = request.params.arguments as unknown as GetContactArgs;
      if (!args.contactId) {
        throw new Error("Missing required argument: contactId");
      }
      const response = await hubspotClient.getContact(args.contactId, args.properties);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • index.ts:1706-1727 (registration)
    Registers the 'hubspot_get_contact' tool (as getContactTool) in the list returned by ListToolsRequest handler.
      return {
        tools: [
          searchContactsTool,
          getContactTool,
          createContactTool,
          updateContactTool,
          listDealsTool,
          getDealTool,
          createDealTool,
          updateDealTool,
          listCompaniesTool,
          getCompanyTool,
          getSalesAnalyticsTool,
          getDealHistoryTool,
          getDealNotesTool,
          getEngagementsByDealTool,
          getSalesPerformanceTool,
          getPipelineAnalyticsTool,
          getForecastAnalyticsTool,
        ],
      };
    });
  • TypeScript interface defining the expected input arguments for the hubspot_get_contact tool.
    interface GetContactArgs {
      contactId: string;
      properties?: string[];
    }

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

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