Node Details

  • Name: CustomTool

  • Type: CustomTool

  • Version: 2.0

  • Category: Tools

Input Parameters

  1. Select Tool

    • Label: Select Tool

    • Name: selectedTool

    • Type: asyncOptions

    • Load Method: listTools

    • Description: Allows the user to select a custom tool from the list of available tools in the database.

  2. Return Direct

    • Label: Return Direct

    • Name: returnDirect

    • Type: boolean

    • Optional: true

    • Description: If set to true, the output of the tool will be returned directly to the user without further processing.

Functionality

  • The node fetches available custom tools from the database and presents them as options for the user to select.

  • It initializes the selected tool with the provided configuration, including any custom overrides for the tool’s name, description, schema, and function.

  • The node supports dynamic variable resolution, allowing the tool to access variables defined in the chatflow.

  • It creates a DynamicStructuredTool instance that can be used within the chatflow to execute the custom tool’s functionality.

Technical Details

  • The node uses TypeORM for database interactions to fetch and manage custom tools.

  • It leverages the Zod library for schema validation and transformation.

  • The custom tool’s function is dynamically evaluated and executed within the context of the chatflow.

  • The node supports overriding various aspects of the tool, including its name, description, schema, and function, allowing for flexible customization.

Use Cases

  • Integrating specialized data processing or analysis tools into a conversation flow.

  • Adding custom API calls or external service integrations within a chatbot interaction.

  • Implementing domain-specific logic or calculations as part of a conversational AI system.

Notes

  • The node requires access to the application’s data source and database entities to function properly.

  • Custom tools must be pre-defined and stored in the database before they can be used with this node.

  • The node supports dynamic schema definition using Zod, allowing for complex input validation for custom tools.