Custom Tools in KorinAI

Learn how to create and manage custom API tools that extend KorinAI's capabilities. This guide explains how to set up API integrations and create custom actions.

Understanding Custom Tools

Custom tools allow you to integrate external APIs and services with KorinAI, enabling the AI to perform specific actions through API calls.

Create New Tool →

Creating a Custom Tool

Basic Configuration

  1. Tool Information

    • Navigate to Function Tools
    • Click "Add New Tool"
    • Provide:
      • Action Name (letters, numbers, underscores only)
      • Clear description of the tool's purpose
      • Access settings (public/private)
  2. Action Settings

    • Configure execution behavior:
      • Always Execute: Tool runs automatically when conditions match
      • Need User Confirmation: Requires user approval before execution
    • Access Control:
      • Public: Available to all users
      • Private: Restricted to specific email addresses

API Configuration

  1. Endpoint Setup

    • Method: Choose HTTP method (GET, POST, PUT, DELETE, PATCH)
    • URL: Enter the API endpoint
    • Query Parameters: Add URL parameters as needed
  2. Headers Configuration

    • Add custom headers
    • Support for dynamic values using AI variables
    • Content-Type automatically managed
  3. Request Body

    • Supports multiple formats:
      • x-www-form-urlencoded
      • form-data
      • JSON
      • Plain text
    • Dynamic values through AI variables
  4. Authentication

    • Multiple auth types:
      • Bearer Token
      • Basic Auth
      • API Key
      • Custom Header
    • Secure credential storage

AI Variables

AI variables are placeholders that KorinAI extracts from user queries to populate API requests.

Variable Configuration

  1. Creating Variables

    • Name: Unique identifier
    • Type: string, number, boolean
    • Description: Clear explanation for AI
    • Nullable: Optional/required status
  2. Variable Usage

    • Format: {{variable_name}}
    • Can be used in:
      • URL parameters
      • Headers
      • Request body
      • Query parameters

Variable Types

  • String: Text values
  • Number: Numeric values
  • Boolean: True/false values

Testing Tools

Test Configuration

  1. Setting Test Values

    • Provide sample values for each AI variable
    • Required variables marked with asterisk (*)
    • Type-specific input fields
  2. Test Execution

    • Click "Test Action"
    • View complete request details:
      • Method & URL
      • Headers
      • Request body
    • Examine response:
      • Status code
      • Response body
      • Formatted JSON view

Debugging Tips

  1. Common Issues

    • Check required variables
    • Verify API endpoint
    • Validate authentication
    • Review request format
  2. Response Analysis

    • Status codes
    • Error messages
    • Response format
    • Expected vs actual results

Best Practices

  1. Tool Design

    • Clear, specific action names
    • Detailed descriptions
    • Appropriate authentication
    • Careful access control
  2. Variable Management

    • Descriptive names
    • Clear descriptions
    • Appropriate types
    • Required vs optional
  3. Testing

    • Regular functionality checks
    • Various input combinations
    • Error handling verification
    • Response validation

Security Considerations

  1. Access Control

    • Use private access for sensitive tools
    • Regular access review
    • Careful credential management
    • Secure variable handling
  2. Authentication

    • Secure token storage
    • Regular credential rotation
    • Appropriate auth type selection
    • Access logging

Quick Actions