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
- Locate the Beanshell element under the Tools Plugin section.
- Drag and drop the File element into the “Drop a tool 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.