Skip to main content
Glama

hubspot_update_company

Modify existing company records in HubSpot CRM by updating specific properties using the company ID, ensuring data accuracy without creating duplicates.

Instructions

Update an existing company in HubSpot (ignores if company does not exist)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_idYesHubSpot company ID to update
propertiesYesCompany properties to update

Implementation Reference

  • Core handler function in HubSpotClient that implements the company update logic using HubSpot CRM API: checks existence, updates properties if exists, handles errors.
    async updateCompany( companyId: string, properties: Record<string, any> ): Promise<any> { try { // Check if company exists try { await this.client.crm.companies.basicApi.getById(companyId); } catch (error: any) { // If company doesn't exist, return a message if (error.statusCode === 404) { return { message: 'Company not found, no update performed', companyId }; } // For other errors, throw them to be caught by the outer try/catch throw error; } // Update the company const apiResponse = await this.client.crm.companies.basicApi.update(companyId, { properties }); return { message: 'Company updated successfully', companyId, properties }; } catch (error: any) { console.error('Error updating company:', error); throw new Error(`HubSpot API error: ${error.message}`); } }
  • MCP CallToolRequestSchema dispatch handler that invokes the HubSpotClient.updateCompany with parsed arguments and formats response.
    case 'hubspot_update_company': { const result = await this.hubspot.updateCompany( args.company_id as string, args.properties as Record<string, any> ); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema defining parameters for hubspot_update_company tool: company_id (required string), properties (required object).
    inputSchema: { type: 'object', properties: { company_id: { type: 'string', description: 'HubSpot company ID to update' }, properties: { type: 'object', description: 'Company properties to update', additionalProperties: true } }, required: ['company_id', 'properties'] }
  • src/index.ts:205-223 (registration)
    Tool registration in ListToolsRequestSchema handler, including name, description, and schema.
    { name: 'hubspot_update_company', description: 'Update an existing company in HubSpot (ignores if company does not exist)', inputSchema: { type: 'object', properties: { company_id: { type: 'string', description: 'HubSpot company ID to update' }, properties: { type: 'object', description: 'Company properties to update', additionalProperties: true } }, required: ['company_id', 'properties'] } }

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

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