Class: Leash::Integration::HubspotClient
- Inherits:
-
Object
- Object
- Leash::Integration::HubspotClient
- Defined in:
- lib/leash/integration/hubspot.rb
Instance Method Summary collapse
-
#hubspot_batch_create_associations(fromobjecttype, toobjecttype, types, inputs) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_batch_create_objects(objecttype, inputs) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_batch_read_objects(objecttype, inputs, properties: nil, propertieswithhistory: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_batch_update_objects(objecttype, inputs) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_create_engagement(type, ownerid, associations, metadata, timestamp: nil) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_create_property(objecttype, name, label, groupname, description: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, hasuniquevalue: nil, calculationformula: nil, externaloptions: nil) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_generate_feedback_link ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_association_definitions(fromobjecttype, toobjecttype) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_engagement(engagementid) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_link(portalid, uidomain, pagerequests) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_property(objecttype, propertyname) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_schemas ⇒ Object
🎯 Purpose: 1.
-
#hubspot_get_user_details ⇒ Object
🎯 Purpose 1.
-
#hubspot_get_workflow(flowid) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_list_associations(objecttype, objectid, toobjecttype, after: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_list_objects(objecttype, limit: nil, after: nil, properties: nil, associations: nil, archived: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_list_properties(objecttype, archived: nil, includehidden: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_list_workflows(limit: nil, after: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_search_objects(objecttype, query: nil, limit: nil, after: nil, properties: nil, sorts: nil, filtergroups: nil) ⇒ Object
🎯 Purpose: 1.
-
#hubspot_update_engagement(engagementid, metadata, associations, ownerid: nil, timestamp: nil) ⇒ Object
🛡️ Guardrails: 1.
-
#hubspot_update_property(objecttype, propertyname, label: nil, description: nil, groupname: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, calculationformula: nil) ⇒ Object
🛡️ Guardrails: 1.
-
#initialize(leash) ⇒ HubspotClient
constructor
Create a new HubSpot integration client.
Constructor Details
#initialize(leash) ⇒ HubspotClient
Create a new HubSpot integration client.
11 12 13 |
# File 'lib/leash/integration/hubspot.rb', line 11 def initialize(leash) @leash = leash end |
Instance Method Details
#hubspot_batch_create_associations(fromobjecttype, toobjecttype, types, inputs) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Establishes relationships between…
74 75 76 77 78 79 80 81 82 |
# File 'lib/leash/integration/hubspot.rb', line 74 def hubspot_batch_create_associations(fromobjecttype, toobjecttype, types, inputs) params = { 'fromObjectType' => fromobjecttype, 'toObjectType' => toobjecttype, 'types' => types, 'inputs' => inputs }.compact @leash.call('hubspot', 'hubspot-batch-create-associations', params) end |
#hubspot_batch_create_objects(objecttype, inputs) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Creates multiple HubSpot objects o…
119 120 121 122 123 124 125 |
# File 'lib/leash/integration/hubspot.rb', line 119 def hubspot_batch_create_objects(objecttype, inputs) params = { 'objectType' => objecttype, 'inputs' => inputs }.compact @leash.call('hubspot', 'hubspot-batch-create-objects', params) end |
#hubspot_batch_read_objects(objecttype, inputs, properties: nil, propertieswithhistory: nil) ⇒ Object
🎯 Purpose: 1. Retrieves multiple HubSpot objects of the same object type by their IDs in a single batch operation. 🧭 Usage Guidance: 1. Use this tool to retrieve objects when the object IDs are k…
147 148 149 150 151 152 153 154 155 |
# File 'lib/leash/integration/hubspot.rb', line 147 def hubspot_batch_read_objects(objecttype, inputs, properties: nil, propertieswithhistory: nil) params = { 'objectType' => objecttype, 'inputs' => inputs, 'properties' => properties, 'propertiesWithHistory' => propertieswithhistory }.compact @leash.call('hubspot', 'hubspot-batch-read-objects', params) end |
#hubspot_batch_update_objects(objecttype, inputs) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Updates multiple existing HubSpot…
132 133 134 135 136 137 138 |
# File 'lib/leash/integration/hubspot.rb', line 132 def hubspot_batch_update_objects(objecttype, inputs) params = { 'objectType' => objecttype, 'inputs' => inputs }.compact @leash.call('hubspot', 'hubspot-batch-update-objects', params) end |
#hubspot_create_engagement(type, ownerid, associations, metadata, timestamp: nil) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Creates a HubSpot engagement (Note…
263 264 265 266 267 268 269 270 271 272 |
# File 'lib/leash/integration/hubspot.rb', line 263 def hubspot_create_engagement(type, ownerid, associations, , timestamp: nil) params = { 'type' => type, 'ownerId' => ownerid, 'timestamp' => , 'associations' => associations, 'metadata' => }.compact @leash.call('hubspot', 'hubspot-create-engagement', params) end |
#hubspot_create_property(objecttype, name, label, groupname, description: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, hasuniquevalue: nil, calculationformula: nil, externaloptions: nil) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Creates new custom properties for…
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/leash/integration/hubspot.rb', line 202 def hubspot_create_property(objecttype, name, label, groupname, description: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, hasuniquevalue: nil, calculationformula: nil, externaloptions: nil) params = { 'objectType' => objecttype, 'name' => name, 'label' => label, 'description' => description, 'groupName' => groupname, 'type' => type, 'fieldType' => fieldtype, 'options' => , 'formField' => formfield, 'hidden' => hidden, 'displayOrder' => displayorder, 'hasUniqueValue' => hasuniquevalue, 'calculationFormula' => calculationformula, 'externalOptions' => }.compact @leash.call('hubspot', 'hubspot-create-property', params) end |
#hubspot_generate_feedback_link ⇒ Object
🎯 Purpose: 1. Use this tool when the user wants to submit feedback about HubSpot MCP tool. 2. Use this tool proactively when the other HubSpot MCP tools are unable to solve the user’s tasks effect…
307 308 309 310 |
# File 'lib/leash/integration/hubspot.rb', line 307 def hubspot_generate_feedback_link params = {} @leash.call('hubspot', 'hubspot-generate-feedback-link', params) end |
#hubspot_get_association_definitions(fromobjecttype, toobjecttype) ⇒ Object
🎯 Purpose: 1. Retrieves valid association types between specific HubSpot object types. 📦 Returns: 1. Array of valid association definitions with type IDs, labels, and categories. 🧭 Usage Guidanc…
89 90 91 92 93 94 95 |
# File 'lib/leash/integration/hubspot.rb', line 89 def hubspot_get_association_definitions(fromobjecttype, toobjecttype) params = { 'fromObjectType' => fromobjecttype, 'toObjectType' => toobjecttype }.compact @leash.call('hubspot', 'hubspot-get-association-definitions', params) end |
#hubspot_get_engagement(engagementid) ⇒ Object
🎯 Purpose: 1. Retrieves a HubSpot engagement by ID.
278 279 280 281 282 283 |
# File 'lib/leash/integration/hubspot.rb', line 278 def hubspot_get_engagement(engagementid) params = { 'engagementId' => engagementid }.compact @leash.call('hubspot', 'hubspot-get-engagement', params) end |
#hubspot_get_link(portalid, uidomain, pagerequests) ⇒ Object
🎯 Purpose: 1. Generates HubSpot UI links for different pages based on object types and IDs. 2. Supports both index pages (lists of objects) and record pages (specific object details). 📋 Prerequis…
326 327 328 329 330 331 332 333 |
# File 'lib/leash/integration/hubspot.rb', line 326 def hubspot_get_link(portalid, uidomain, pagerequests) params = { 'portalId' => portalid, 'uiDomain' => uidomain, 'pageRequests' => pagerequests }.compact @leash.call('hubspot', 'hubspot-get-link', params) end |
#hubspot_get_property(objecttype, propertyname) ⇒ Object
🎯 Purpose: 1. This tool retrieves detailed information about a specific property for a HubSpot object type. 2. You can use this to get all metadata related to a property, including its type, optio…
177 178 179 180 181 182 183 |
# File 'lib/leash/integration/hubspot.rb', line 177 def hubspot_get_property(objecttype, propertyname) params = { 'objectType' => objecttype, 'propertyName' => propertyname }.compact @leash.call('hubspot', 'hubspot-get-property', params) end |
#hubspot_get_schemas ⇒ Object
🎯 Purpose: 1. Retrieves all custom object schemas defined in the HubSpot account. 🧭 Usage Guidance: 1. Before working with custom objects to understand available object types, their properties, a…
315 316 317 318 |
# File 'lib/leash/integration/hubspot.rb', line 315 def hubspot_get_schemas params = {} @leash.call('hubspot', 'hubspot-get-schemas', params) end |
#hubspot_get_user_details ⇒ Object
🎯 Purpose 1. Authenticates and analyzes the current HubSpot access token, providing context about the user’s permissions and account details. 🧭 Usage Guidance: 1. This tool must be used before pe…
18 19 20 21 |
# File 'lib/leash/integration/hubspot.rb', line 18 def hubspot_get_user_details params = {} @leash.call('hubspot', 'hubspot-get-user-details', params) end |
#hubspot_get_workflow(flowid) ⇒ Object
🎯 Purpose: 1. This tool retrieves detailed information about a specific workflow from the HubSpot account. 🧭 Usage Guidance: 1. Use the “flowId” parameter to specify which workflow to retrieve. 2…
352 353 354 355 356 357 |
# File 'lib/leash/integration/hubspot.rb', line 352 def hubspot_get_workflow(flowid) params = { 'flowId' => flowid }.compact @leash.call('hubspot', 'hubspot-get-workflow', params) end |
#hubspot_list_associations(objecttype, objectid, toobjecttype, after: nil) ⇒ Object
🎯 Purpose: 1. Retrieves existing relationships between a specific object and other objects of a particular type. 2. For example, you can find all companies that a contact is associated with, all d…
104 105 106 107 108 109 110 111 112 |
# File 'lib/leash/integration/hubspot.rb', line 104 def hubspot_list_associations(objecttype, objectid, toobjecttype, after: nil) params = { 'objectType' => objecttype, 'objectId' => objectid, 'toObjectType' => toobjecttype, 'after' => after }.compact @leash.call('hubspot', 'hubspot-list-associations', params) end |
#hubspot_list_objects(objecttype, limit: nil, after: nil, properties: nil, associations: nil, archived: nil) ⇒ Object
🎯 Purpose: 1. Retrieves a paginated list of objects of a specified type from HubSpot. 📦 Returns: 1. Collection of objects with their properties and metadata, plus pagination information. 🧭 Usage…
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/leash/integration/hubspot.rb', line 32 def hubspot_list_objects(objecttype, limit: nil, after: nil, properties: nil, associations: nil, archived: nil) params = { 'objectType' => objecttype, 'limit' => limit, 'after' => after, 'properties' => properties, 'associations' => associations, 'archived' => archived }.compact @leash.call('hubspot', 'hubspot-list-objects', params) end |
#hubspot_list_properties(objecttype, archived: nil, includehidden: nil) ⇒ Object
🎯 Purpose: 1. This tool retrieves a complete catalog of properties for any HubSpot object type. 🧭 Usage Guidance: 1. This API has a large response that can consume a lot of tokens. Use the hubspo…
163 164 165 166 167 168 169 170 |
# File 'lib/leash/integration/hubspot.rb', line 163 def hubspot_list_properties(objecttype, archived: nil, includehidden: nil) params = { 'objectType' => objecttype, 'archived' => archived, 'includeHidden' => includehidden }.compact @leash.call('hubspot', 'hubspot-list-properties', params) end |
#hubspot_list_workflows(limit: nil, after: nil) ⇒ Object
🎯 Purpose: 1. This tool retrieves a paginated list of workflows from the HubSpot account. 🧭 Usage Guidance: 1. Use the “limit” parameter to control the number of results returned per page. 2. For…
340 341 342 343 344 345 346 |
# File 'lib/leash/integration/hubspot.rb', line 340 def hubspot_list_workflows(limit: nil, after: nil) params = { 'limit' => limit, 'after' => after }.compact @leash.call('hubspot', 'hubspot-list-workflows', params) end |
#hubspot_search_objects(objecttype, query: nil, limit: nil, after: nil, properties: nil, sorts: nil, filtergroups: nil) ⇒ Object
🎯 Purpose: 1. Performs advanced filtered searches across HubSpot object types using complex criteria. 📋 Prerequisites: 1. Use the hubspot-list-objects tool to sample existing objects for the obje…
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/leash/integration/hubspot.rb', line 54 def hubspot_search_objects(objecttype, query: nil, limit: nil, after: nil, properties: nil, sorts: nil, filtergroups: nil) params = { 'objectType' => objecttype, 'query' => query, 'limit' => limit, 'after' => after, 'properties' => properties, 'sorts' => sorts, 'filterGroups' => filtergroups }.compact @leash.call('hubspot', 'hubspot-search-objects', params) end |
#hubspot_update_engagement(engagementid, metadata, associations, ownerid: nil, timestamp: nil) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Updates an existing HubSpot engage…
293 294 295 296 297 298 299 300 301 302 |
# File 'lib/leash/integration/hubspot.rb', line 293 def hubspot_update_engagement(engagementid, , associations, ownerid: nil, timestamp: nil) params = { 'engagementId' => engagementid, 'ownerId' => ownerid, 'timestamp' => , 'metadata' => , 'associations' => associations }.compact @leash.call('hubspot', 'hubspot-update-engagement', params) end |
#hubspot_update_property(objecttype, propertyname, label: nil, description: nil, groupname: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, calculationformula: nil) ⇒ Object
🛡️ Guardrails: 1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM. 🎯 Purpose: 1. Updates existing custom properties…
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/leash/integration/hubspot.rb', line 237 def hubspot_update_property(objecttype, propertyname, label: nil, description: nil, groupname: nil, type: nil, fieldtype: nil, options: nil, formfield: nil, hidden: nil, displayorder: nil, calculationformula: nil) params = { 'objectType' => objecttype, 'propertyName' => propertyname, 'label' => label, 'description' => description, 'groupName' => groupname, 'type' => type, 'fieldType' => fieldtype, 'options' => , 'formField' => formfield, 'hidden' => hidden, 'displayOrder' => displayorder, 'calculationFormula' => calculationformula }.compact @leash.call('hubspot', 'hubspot-update-property', params) end |