Skip to main content
Glama
lkm1developer

HubSpot MCP Server

hubspot_update_contact

Update existing HubSpot contact information by specifying contact ID and properties to modify. Maintains current data if contact does not exist.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idYesHubSpot contact ID to update
propertiesYesContact properties to update

Implementation Reference

  • The primary handler function that executes the tool logic: checks if the contact exists using getById, then updates the properties via HubSpot CRM contacts.basicApi.update. Returns success message or handles not found gracefully.
    async updateContact(
      contactId: string,
      properties: Record<string, any>
    ): Promise<any> {
      try {
        // Check if contact exists
        try {
          await this.client.crm.contacts.basicApi.getById(contactId);
        } catch (error: any) {
          // If contact doesn't exist, return a message
          if (error.statusCode === 404) {
            return {
              message: 'Contact not found, no update performed',
              contactId
            };
          }
          // For other errors, throw them to be caught by the outer try/catch
          throw error;
        }
    
        // Update the contact
        const apiResponse = await this.client.crm.contacts.basicApi.update(contactId, {
          properties
        });
    
        return {
          message: 'Contact updated successfully',
          contactId,
          properties
        };
      } catch (error: any) {
        console.error('Error updating contact:', error);
        throw new Error(`HubSpot API error: ${error.message}`);
      }
    }
  • src/index.ts:186-204 (registration)
    Tool registration in the ListToolsRequestHandler, defining name, description, and input schema.
    {
      name: 'hubspot_update_contact',
      description: 'Update an existing contact in HubSpot (ignores if contact does not exist)',
      inputSchema: {
        type: 'object',
        properties: {
          contact_id: { 
            type: 'string', 
            description: 'HubSpot contact ID to update' 
          },
          properties: { 
            type: 'object', 
            description: 'Contact properties to update',
            additionalProperties: true
          }
        },
        required: ['contact_id', 'properties']
      }
    },
  • Input schema defining required contact_id and arbitrary properties object for the tool.
    inputSchema: {
      type: 'object',
      properties: {
        contact_id: { 
          type: 'string', 
          description: 'HubSpot contact ID to update' 
        },
        properties: { 
          type: 'object', 
          description: 'Contact properties to update',
          additionalProperties: true
        }
      },
      required: ['contact_id', 'properties']
  • MCP server handler dispatcher in CallToolRequestHandler that invokes the HubSpotClient updateContact method and formats the response.
    case 'hubspot_update_contact': {
      const result = await this.hubspot.updateContact(
        args.contact_id as string,
        args.properties as Record<string, any>
      );
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
Behavior3/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 adds useful context by stating 'ignores if contact does not exist', which clarifies idempotent behavior. However, it lacks details on permissions, rate limits, response format, or whether updates are partial/complete, leaving gaps for a mutation tool.

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 a single, efficient sentence that is front-loaded with the core purpose and includes a key behavioral note. There is no wasted text, and it effectively communicates essential information in minimal words.

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 the tool's complexity as a mutation operation with no annotations and no output schema, the description is moderately complete. It covers the basic purpose and one behavioral trait but lacks details on permissions, error responses, or update semantics. For a 2-parameter tool with high schema coverage, it's adequate but has clear gaps.

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 documents both parameters ('contact_id' and 'properties') adequately. The description doesn't add any additional meaning or examples beyond what the schema provides, such as property format or validation rules. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Update') and resource ('an existing contact in HubSpot'), making the purpose specific and understandable. It distinguishes from sibling tools like 'hubspot_create_contact' by focusing on updates rather than creation. However, it doesn't explicitly differentiate from 'hubspot_update_company', which is a minor gap.

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 implies usage by specifying 'ignores if contact does not exist', which suggests it's for updating existing contacts only. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'hubspot_create_contact' or 'hubspot_update_company', nor does it mention prerequisites or error handling beyond the ignore behavior.

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