Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

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:

...

  1. Locate the Beanshell element under the Tools Plugin section in the palette.
  2. Drag and drop the File element into the “Drop the Drop a tool here” section.to here section.
    Image Added

Configure form properties

Image Added

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

NameDescription
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.