Skip to main content
Glama
ajaystream

HubSpot MCP Server

by ajaystream

hubspot-get-workflow

Retrieve detailed information about a specific HubSpot workflow, including actions, enrollment criteria, and scheduling, using the workflow ID.

Instructions

🎯 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. This endpoint returns complete workflow information including actions, enrollment criteria, and scheduling.
  3. Use the hubspot-list-workflows tool first to identify the workflow ID you need.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowIdYesThe ID of the workflow to retrieve

Implementation Reference

  • The handler function that executes the core logic of the tool by calling the HubSpot API to retrieve workflow details for the given flowId.
    async process(args) {
        try {
            const response = await this.client.get(`/automation/v4/flows/${args.flowId}`);
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify(response, null, 2),
                    },
                ],
            };
        }
        catch (error) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error retrieving HubSpot workflow (ID: ${args.flowId}): ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Input schema using Zod for validation of flowId parameter and the complete tool definition including name, description, and JSON schema conversion.
    const GetWorkflowSchema = z.object({
        flowId: z.string().describe('The ID of the workflow to retrieve'),
    });
    const ToolDefinition = {
        name: 'hubspot-get-workflow',
        description: `
        🎯 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. This endpoint returns complete workflow information including actions, enrollment criteria, and scheduling.
          3. Use the hubspot-list-workflows tool first to identify the workflow ID you need.
      `,
        inputSchema: zodToJsonSchema(GetWorkflowSchema),
        annotations: {
            title: 'Get HubSpot Workflow Details',
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: true,
        },
    };
  • Registers an instance of the GetWorkflowTool in the central tools registry.
    registerTool(new GetWorkflowTool());

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