Skip to content

Build a Custom Scoring Tool

Create a reusable scoring tool with the AI wizard, then use it from chat to evaluate leads, prioritize tasks, or calculate metrics.

What You'll Use

FeaturePurpose
Custom ToolsReusable JavaScript functions agents can call
AI WizardGenerates tool code from a plain-language description
Chat (Action Mode)Test the tool interactively

Step 1: Create the Tool

  1. Go to Custom Tools in the sidebar.
  2. Click Create Tool.
  3. In the description field, explain what you want in plain language:

"Calculate a lead score from 0 to 100 based on three inputs: company size (number of employees), whether their industry matches our target verticals (boolean), and engagement level (low, medium, or high). Company size over 500 adds 30 points, industry match adds 40 points, and engagement adds 10/20/30 points."

  1. Click Generate. The AI wizard creates:

    • A name and description for the tool
    • An input schema defining the expected parameters
    • JavaScript code implementing the logic
  2. Review the generated code. It runs in a sandbox with a 5-second timeout and no network access — it is pure computation.

  3. Click Save.

INFO

Custom tools are for calculations, formatting, and transformations — not for calling external APIs. Use connections for external integrations.

Step 2: Use It from Chat

  1. Open the Chat panel and select an agent.
  2. Switch to Action Mode.
  3. Ask the agent to use your tool:

"Score this lead: Globex Corp, 1,200 employees, industry match, high engagement."

  1. The agent calls your custom tool with the right parameters and returns the result:

Globex Corp scores 100/100 — 30 points for company size (1,200 > 500), 40 points for industry match, and 30 points for high engagement. This is a top-tier lead.

  1. Expand the execution trace below the response to see the tool call, input values, and raw output.

Step 3: Use It in Bulk

You can also ask the agent to score multiple items:

"Score these three leads and rank them: (1) Initech, 50 employees, no industry match, medium engagement. (2) Umbrella Corp, 800 employees, industry match, low engagement. (3) Stark Industries, 5,000 employees, industry match, high engagement."

The agent calls the tool three times and presents a ranked list.

TIP

Custom tools work in workflows too. Once you trust the scoring logic, create a workflow that pulls leads from a connected database and scores them automatically.

What to Try Next