Last modified: September 3, 2025
In HubSpot, you can create an AI agent that will perform various actions based on your instructions. For example, you can create an agent to send an email to you every morning with notes about the day’s upcoming meetings.
To perform tasks, agents rely on agent tools. Tools are like functions in a programming language: they have parameters you pass into the tool, and the tool returns an output. Tools in HubSpot are similar to the concept of tools in MCP (Model Context Protocol). An agent tool will package API calls, LLM steps, and other supporting context to enable the AI to do the job. Tools are designed to perform specific, well-defined tasks, such as querying a database, performing CRUD (Create, Read, Update, Delete) operations, or using generative AI to summarize content.
In implementation terms, an agent tool is an enhanced version of a custom workflow action, which you’ll build using HubSpot’s developer project framework. This tutorial will guide you through how to start building an agent tool.
Prerequisites
Before getting started, you’ll need to:- Install the latest version of the HubSpot CLI by running
npm install -g @hubspot/cli
. If you’ve already installed the CLI, you can update to the latest version by runningnpm install -g @hubspot/cli@latest
. - Create a developer test account from within the developer account that’s opted in to the beta.
- Authenticate the test account with the CLI by running the
hs account auth
command in your terminal.
Build and deploy an agent tool
1
Create a project
If you’re starting from scratch, you’ll first need to create a new project. Alternatively, if you’d like to use an existing project (project version
2025.2
required), skip to the next section.To create a new project:- In the terminal, run the command below to create a new project from one of the boilerplate quickstart templates.
- Follow the terminal prompts to configure the project name and location, then select a template. Several template options are provided depending on how you plan to distribute your app. For the purposes of this tutorial, select the Getting stated project with marketplace app template.
- The project template will then be downloaded to your working directory where you can view its contents.
2
Add an agent tool to the project
- If your project doesn’t have one yet, create a
workflow-actions/
directory insrc/app/
. - In the
workflow-actions
directory, create a new JSON file for the tool configuration. The file can have any name, but must end with-hsmeta.json
(e.g.,my-agent-tool-hsmeta.json
). - Build out the action configuration using the agent tools reference documentation. Be sure to include the
supportedClients
array along with itsclient
,toolType
, andllmConfig
fields, as shown in the example code below.
- When actively developing, you should not set your input fields to required, as required fields cannot be updated or removed once uploaded.
- Requests to public endpoints will be made as
POST
requests. - Unlike custom workflow actions, you cannot include functions in agent tools.
- The agent does not have access to CRM data unless explicitly given tools to get that data.
- The agent can’t request information from the user after it’s invoked if given insufficient information to complete the task.
hs project upload
. If you started with a new project, you’ll be prompted press y
to create the project in the account.Testing agent tools in HubSpot
There are multiple aspects of your agent tool that you’ll want to test before making it available to users. HubSpot provides two primary methods for testing: the workflows tool, and the developer tool testing agent.Test with workflows
It’s recommended to start testing with a workflow to evaluate the core logic of your tool. Using workflows for testing is especially useful for testing input and output behavior, such as providing both correct and incorrect inputs to see what the result is. This is the same type of testing you would perform for a custom workflow action, as tools are custom workflow actions with additional fields for agent configuration. To test with workflows:- Create a workflow.
- Add your tool as a workflow action.
- Ensure you’re passing the inputs and outputs you want to pass, then execute the workflow.
- Iterate on your back-end code to ensure the logic is properly handling the inputs and returning the expected outputs.
Test with the developer tool testing agent
Using HubSpot’s Developer Tool Testing Agent, you can test how your tool works in the context of an agent. Testing with this method will help you to better understand the LLM side of your agent tool and how it will behave for end-users prompting the agent. To use the Developer Tool Testing Agent:- Navigate to the Developer Tool Testing Agent in the HubSpot Marketplace.
- Click Sign in to add to navigate to the install page in your account. Once in your account, click Add to install the agent.
- In the pop-up banner, click Configure. Alternatively, you can click Open to open the agent page, then click Configure in the top right.
- In the What this agent can access section, click Add tool.

- In the right sidebar, select your agent tool.
- Tool name and description clarity: test whether the LLM correctly understands when to use your tool based on its name and description, especially when compared to other default or custom tools.
- Direct vs. indirect prompts: test both direct commands (e.g., “Use Tool X to do Y”) and more abstract, goal-oriented prompts to see if the LLM can correctly infer the user’s intent. Ideally the user doesn’t need to tell the agent to use a tool, the agent can intuit what it needs to do and just execute.
- Parameter extraction: verify that the agent correctly identifies and extracts all required parameters from natural language prompts. The testing agent is designed to report exactly what parameters it passed to help with this verification.
- Sequential operations: test scenarios where your tool must work in a sequence with other tools. This includes checking if the agent can correctly pass the output from one tool as the input for the next.
llmConfig
and your labels
properties in your tool’s hsmeta.json
file to give the LLM more clarity and specificity into what your tool does, and how to provide inputs to it.