Skip to main content
Glama
ajaystream

HubSpot MCP Server

by ajaystream

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
NameRequiredDescriptionDefault
engagementIdYesThe 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,
        },
    };
  • Registers an instance of the GetEngagementTool in the central tools registry.
    registerTool(new GetEngagementTool());

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/ajaystream/hubspot-mcp-custom'

If you have feedback or need assistance with the MCP directory API, please join our Discord server