hubspot-get-engagement
Retrieve HubSpot engagements by ID to access CRM interaction data, enabling users to view specific customer touchpoints and communication records.
Instructions
🎯 Purpose:
1. Retrieves a HubSpot engagement by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engagementId | Yes | The ID of the engagement to retrieve |
Implementation Reference
- The process method of GetEngagementTool class executes the tool logic: fetches engagement by ID from HubSpot API and returns formatted response or error.async process(args) { try { const { engagementId } = args; const response = await this.client.get(`/engagements/v1/engagements/${engagementId}`); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving HubSpot engagement: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; }
- Defines the input schema using Zod for engagementId and the full tool definition including name, description, and JSON schema conversion.const GetEngagementSchema = z.object({ engagementId: z.number().int().positive().describe('The ID of the engagement to retrieve'), }); const ToolDefinition = { name: 'hubspot-get-engagement', description: ` 🎯 Purpose: 1. Retrieves a HubSpot engagement by ID. `, inputSchema: zodToJsonSchema(GetEngagementSchema), annotations: { title: 'Get Engagement', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, };
- dist/tools/toolsRegistry.js:41-41 (registration)Registers an instance of the GetEngagementTool in the central tools registry.registerTool(new GetEngagementTool());