Tools & Function Calling

Extend your chatbot with database queries, web search, and custom functions.


Overview

Tools let your chatbot do more than just answer questions — it can take actions. When a user asks something that requires real data or an external action, the AI autonomously decides to call the appropriate tool and uses the result in its response.


How Tools Work

  1. You enable and configure tools in your chatbot's settings
  2. When a user asks a question, the AI analyzes whether a tool is needed
  3. If so, the AI calls the tool with the right parameters
  4. The tool returns data
  5. The AI uses that data to craft its response

This happens transparently — the user just sees a natural, data-backed answer.


Available Tools

Database Query

Let your chatbot query a connected database and return structured results.

Use cases:

  • "How many orders did we get this week?"
  • "What is the status of order #12345?"
  • "Show me the top 10 customers by revenue"

Configuration:

  1. Go to your chatbot's Advanced Settings
  2. Enable the Database Query tool
  3. Provide your database connection details
  4. Define allowed queries or schemas the chatbot can access

The AI generates SQL queries based on the user's natural language question, executes them, and formats the results.

Custom Functions

Define your own tools that the AI can invoke during a conversation.

Use cases:

  • Check inventory levels
  • Create support tickets
  • Look up user accounts
  • Calculate pricing quotes

Configuration:

  1. Define a function name and description
  2. Specify the parameters the function accepts (as a JSON schema)
  3. Implement the function endpoint
  4. The AI will call your function when it determines it is relevant

Tool Execution Flow

User: "What is the status of order #12345?"
         |
    AI decides: needs database_query tool
         |
    Tool call: SELECT status FROM orders WHERE id = 12345
         |
    Result: { status: "shipped", tracking: "1Z999..." }
         |
    AI response: "Order #12345 has been shipped.
                  Tracking number: 1Z999..."

Security Considerations

  • Read-only by default — Database tools should be configured with read-only access
  • Query validation — The system validates generated queries before execution
  • Rate limiting — Tool calls are subject to the same rate limits as chat messages
  • API key isolation — Each chatbot uses its own API key and tool configuration

Next Steps