hubspot-get-engagement
Retrieve a specific HubSpot engagement by its unique ID to access detailed interaction data, enabling efficient CRM insights and management.
Instructions
🎯 Purpose:
1. Retrieves a HubSpot engagement by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engagementId | Yes | The ID of the engagement to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"engagementId": {
"description": "The ID of the engagement to retrieve",
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"engagementId"
],
"type": "object"
}
Implementation Reference
- The process method implements the core logic: extracts engagementId, calls HubSpotClient.get on /engagements/v1/engagements/{id}, returns formatted JSON response or error message.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, }; } }
- Input validation schema (engagementId: positive integer) and tool metadata including name, description, JSON schema from Zod, and annotations.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)Instantiates and registers the GetEngagementTool in the central tools registry.registerTool(new GetEngagementTool());