Code Tools
Code tools are specialized functions that process user input based on predefined business logic. They’re designed to help agents complete tasks by executing custom scripts as part of their regular operations. This ensures that responses are tailored to the user’s specific needs. Code tools primarily utilize JavaScript and Python to process the input data and generate the appropriate output. Example SQL Query Processor - This tool is designed to run SQL queries on a specified database instance. It leverages Supabase APIs to dynamically execute SQL queries, allowing for flexible and efficient data retrieval and manipulation. To create a code tool, click +Create Tool in the Tools page while creating the agent and select Code Tool. Provide the following details for the tool. Name: Enter a unique and descriptive name for the tool to help identify its purpose. Example: SQL Query Processor Description Provide a clear and detailed description of the tool’s functionality. This helps the agent understand:- What the tool does.
- When to use it.
- How to use it.
- Name: A unique identifier for the parameter.
- Description: Explains the parameter’s purpose to help the agent extract relevant data from user input.
- Type: The expected data type (e.g., string, number, boolean).
- Parameter Name: query
- Type: String
- Description: The SQL query to be executed.