Font Size:

Beanshell Tool

Introduction

The Beanshell Tool allows you to define custom Java-based functions that can be invoked from within your AI agent using function calls. This gives you the flexibility to extend your agent's capabilities with programmable logic, calculations, or utilities, entirely outside the AI model itself.

Beanshell Tools are designed for function-style reusability. You can define multiple tools that accept arguments, process them using Java logic, and return results to the AI agent.

Get started

How to use it

To use the Beanshell Element:

Adding the Beanshell tools

  1. Locate the Beanshell element under the Tools section in the palette.
  2. Drag and drop the element into the Drop a tool to here section.

Configure Form Properties

To properly integrate and configure the Beanshell, set the following fields:

  • Function Name: Unique name used to call this tool function from the AI agent.
  • Function Description: Human-readable explanation of what this function does.
  • Function Arguments: Define the expected input parameters for this function.
    • Name: The variable name of the argument (used in the script).
    • Data Type: Expected type (e.g., String, Number, Boolean).
    • Description: Purpose or meaning of the argument.
    • Is Required?: Whether the argument must be provided.
  • Script: Beanshell (Java-like) code implementing the logic. Use argument names as variables. Return your result using the return keyword.
Created by Gabriel Last modified by Gabriel on Jun 24, 2025