Class HubSpotTools

java.lang.Object
com.tnsai.tools.crm.HubSpotTools

public class HubSpotTools extends Object
Function-shape HubSpot CRM tools — contact management via HubSpot's CRM v3 REST API. Replaces the HubSpot half of the legacy UnifiedCRMTool. The Salesforce half is intentionally deferred — Salesforce auth (OAuth2 + instance URL) and SOQL query syntax need a dedicated POJO.
MethodEndpointIdempotent
hubspotListContacts(int)GET /crm/v3/objects/contactstrue
hubspotGetContact(java.lang.String)GET /crm/v3/objects/contacts/{id}true
hubspotCreateContact(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)POST /crm/v3/objects/contactsfalse (creates a contact)

Requires HUBSPOT_ACCESS_TOKEN (Private App token from HubSpot → Settings → Integrations → Private Apps). Bearer auth.

Since:
0.5.7 (Phase 2 batch 29 — built-in tool migration to function shape, see #188)
  • Constructor Details

    • HubSpotTools

      public HubSpotTools()
      Default constructor — picks HUBSPOT_ACCESS_TOKEN from env.
    • HubSpotTools

      public HubSpotTools(String accessToken)
      Explicit-token constructor.
    • HubSpotTools

      public HubSpotTools(String accessToken, okhttp3.OkHttpClient http, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Full constructor for tests / shared HTTP.
  • Method Details

    • hubspotListContacts

      @Tool(name="hubspot_list_contacts", description="List HubSpot contacts (paginated). {limit} clamps to [1, 100]. Returns the raw HubSpot JSON response with the contacts array under \"results\". Requires HUBSPOT_ACCESS_TOKEN.", keywords={"hubspot","crm","contacts","list","leads"}, idempotent=true) public String hubspotListContacts(@ToolParam(description="Max contacts (1..100); 0 \u2192 default 10",required=false,defaultValue="0") int limit) throws IOException
      Throws:
      IOException
    • hubspotGetContact

      @Tool(name="hubspot_get_contact", description="Fetch a single HubSpot contact by id. Returns the raw JSON contact object with email / firstname / lastname / phone / company / created_at properties. Requires HUBSPOT_ACCESS_TOKEN.", keywords={"hubspot","crm","contact","get","lead"}, idempotent=true) public String hubspotGetContact(@ToolParam(description="HubSpot contact id") String contactId) throws IOException
      Throws:
      IOException
    • hubspotCreateContact

      @Tool(name="hubspot_create_contact", description="Create a new HubSpot contact. {email} is required; all other properties are optional. Returns the raw JSON of the created contact (with HubSpot-assigned id). NOT idempotent \u2014 every call creates a new contact (use the upsert endpoint via http_request if you need merge-by-email semantics).", keywords={"hubspot","crm","contact","create","lead"}, idempotent=false) public String hubspotCreateContact(@ToolParam(description="Contact email (required)") String email, @ToolParam(description="Optional first name",required=false,defaultValue="") String firstname, @ToolParam(description="Optional last name",required=false,defaultValue="") String lastname, @ToolParam(description="Optional phone number",required=false,defaultValue="") String phone, @ToolParam(description="Optional company name",required=false,defaultValue="") String company) throws IOException
      Throws:
      IOException