Skip to main content
Glama
lkm1developer

HubSpot MCP Server

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']
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals one important behavioral trait ('ignores if company does not exist'), which is valuable context not in the schema. However, it doesn't disclose other critical behaviors: whether this is a partial or full update, what permissions are required, whether changes are reversible, rate limits, or what happens when properties are invalid. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 extremely concise - a single sentence that communicates the core purpose and one key behavioral constraint. Every word earns its place with no redundancy or fluff. The structure is front-loaded with the primary action and includes the important qualifier at the end.

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

Completeness3/5

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

Given this is a mutation tool with no annotations and no output schema, the description provides minimal but essential context about the update operation and its behavior with non-existent companies. However, it doesn't address what the tool returns, error conditions, authentication requirements, or how property updates interact with existing data. For a tool that modifies business data, this leaves important gaps in understanding.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain property format expectations, validation rules, or provide examples. The baseline score of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('an existing company in HubSpot'), making the purpose immediately understandable. It distinguishes from 'hubspot_create_company' by specifying it updates existing records rather than creating new ones. However, it doesn't explicitly differentiate from 'hubspot_update_contact' beyond the resource type.

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 provides some usage context by stating it 'ignores if company does not exist', which implies it should only be used when you know the company exists or want a no-op behavior for missing companies. However, it doesn't explicitly guide when to use this versus alternatives like 'hubspot_create_company' or provide any prerequisites about required permissions or data formats.

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

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