Skip to main content
Tools (function calling) allow agents to perform actions beyond just talking. This turns a conversational bot into a capable assistant.

Tool Configuration

A tool consists of:
  1. Name: Unique identifier (e.g., check_inventory).
  2. Description: Natural language explanation of when the LLM should use this tool (e.g., “Use this to check if an item is in stock”).
  3. API Config:
    • URL: The endpoint to call.
    • Method: GET, POST, PUT, DELETE.
    • Headers: Auth tokens or content types.
    • Parameters: JSON Schema defining the data the LLM needs to extract from the user.

Example

Scenario: A user asks, “Do you have any red sneakers in size 10?” Tool Config:
{
  "name": "check_inventory",
  "description": "Checks stock availability",
  "parameters": {
    "type": "object",
    "properties": {
      "item": {"type": "string"},
      "color": {"type": "string"},
      "size": {"type": "integer"}
    }
  }
}
Flow:
  1. LLM analyzes user speech.
  2. LLM decides to call check_inventory with {"item": "sneakers", "color": "red", "size": 10}.
  3. Butter AI executes the HTTP request to your backend.
  4. Your backend returns {"available": true, "quantity": 5}.
  5. LLM receives this data and says: “Yes, we have 5 pairs in stock.”

Creating Tools

You can create tools via the API and then add the tool_id to your agent’s custom_tools list.