Skip to main content
Glama

hubspot_update_company

Modify existing company records in HubSpot CRM by updating specific properties using the company ID. Ensures data accuracy by only processing valid company entries.

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 logic for updating a HubSpot company: checks if company exists, updates properties via HubSpot API, handles 404 gracefully, and returns success/error info.
    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 tool execution handler: receives arguments, calls HubSpotClient.updateCompany, and returns JSON-formatted result as MCP 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) }] }; }
  • src/index.ts:205-223 (registration)
    Tool registration in ListTools handler: defines name, description, and input schema for hubspot_update_company.
    { 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'] } }
  • Input schema definition validating company_id (string, required) and properties (object, required).
    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