Building Custom Tools for AI Agents

Custom tools allow you to extend your AI agents' capabilities with specific functionalities. This guide will walk you through the process of creating and integrating custom tools.

Understanding Custom Tools

Custom tools are TypeScript functions that agents can call to perform specific tasks or retrieve information.

Creating a Custom Tool

  1. Access the Tool Editor
    • Navigate to the "AI" section
    • Click "Tools" at the top
    • Click "Create tool"
  2. Define Tool Basics
    • Name: Choose a descriptive name (e.g., "fetchProjectStatus")
    • Description: Explain the tool's purpose and functionality
  3. Write the Tool Code
    • Use TypeScript to define your tool's functionality
    • Implement error handling and input validation
  4. Define Arguments
    • Specify the input parameters your tool requires
    • Choose appropriate data types for each argument
  5. Set Visibility and Permissions
    • Decide who can access and use your tool
    • Choose whether the tool can be forked by others

Example Custom Tool

Here's a simple example of a custom tool that fetches a project's status:

interface ToolArguments {
  projectId: string;
}

async function fetchProjectStatus(args: ToolArguments): Promise<string> {
  const { projectId } = args;
  
  // Implement your logic to fetch project status
  // This is a placeholder implementation
  const status = await someAPICall(projectId);
  
  return `The status of project ${projectId} is: ${status}`;
}

Assigning Tools to Agents

Once you've created a custom tool, you can assign it to specific agents to extend their capabilities.

  1. Access the Agent Editor
    • Navigate to the "AI Agents" section
    • Click on the agent you want to assign the tool to
  2. Add the Tool
    • In the Advanced section under "Advanced Tools" you will see your available tools.
    • Select the custom tool you created

By creating and assigning custom tools, you can tailor your AI agents to meet specific needs and workflows within your organization.

Next: Learn about Skills and Automations to further enhance your agents' capabilities.