Skip to main content

What Are Tools?

Tools extend what your AI agent can do beyond answering questions. With tools, your agent can:
  • Fetch data from external APIs (product info, order status, weather)
  • Display rich content (product cards, carousels, tables)
  • Collect information through interactive forms
  • Trigger actions in your systems (create tickets, send notifications)
Tools dashboard

Tool Types

Ansa supports three types of tool execution:
TypeDescriptionUse Case
httpMakes HTTP requests to APIsFetch data, trigger webhooks
formDisplays interactive formsCollect user information
mockReturns static/templated responsesTesting, demos

Creating a Tool

Navigate to Agent → Tools → Create Tool:

Basic Configuration

Every tool needs:
FieldDescriptionExample
NameUnique identifier (lowercase, underscores)search_products
DescriptionWhen should the AI use this tool?”Search for products when user asks about items”
Input SchemaParameters the tool acceptsSee below

Naming Conventions

Tool names must:
  • Start with a letter or underscore
  • Use only lowercase letters, numbers, and underscores
  • Be unique within the agent
Pattern: /^[a-z_][a-z0-9_]*$/ search_products, get_order_status, contact_formSearch Products, get-order, 123tool

Input Schema

Define what parameters the AI should provide:
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "The search term to look for"
    },
    "category": {
      "type": "string",
      "description": "Product category to filter by",
      "enum": ["electronics", "clothing", "home"]
    },
    "limit": {
      "type": "number",
      "description": "Maximum number of results"
    }
  },
  "required": ["query"]
}
Write clear descriptions for each property. The AI uses these to understand what values to provide.

How the AI Uses Tools

When a user sends a message, the AI:
  1. Analyzes the user’s request
  2. Decides if a tool would help answer it
  3. Extracts the required parameters from the conversation
  4. Calls the tool with those parameters
  5. Processes the result and responds naturally
The AI decides to use a tool based on the tool’s description. Write descriptions that clearly explain when the tool should be used: Good descriptions:
  • “Search for products when the user asks about items, prices, or availability”
  • “Look up order status when user provides an order number or asks about shipping”
  • “Show the contact form when user wants to reach support or has an issue you cannot resolve”
Poor descriptions:
  • “Product search” (too vague)
  • “Use this tool” (no context)

LLM Provider Differences

Different AI providers handle tool calling differently:

Native Tool Calling

These providers have built-in support for tools:
ProviderModelsReliability
AnthropicClaude 3.5 Sonnet, Claude 3 OpusExcellent
OpenAIGPT-4o, GPT-4 Turbo, GPT-3.5 TurboExcellent
GoogleGemini Pro, Gemini UltraGood

Text-Based Fallback (Ollama)

Local models via Ollama don’t have native tool calling. Ansa uses a text-based fallback:
  1. Tool definitions are injected into the system prompt
  2. The model is instructed to output JSON when using tools:
    {"tool": "tool_name", "arguments": {"param": "value"}}
    
  3. Ansa parses the JSON from the response
Text-based tool calling is less reliable than native support. For complex tool use, prefer Claude or GPT models. Ollama works best for simple tools or when privacy is the priority.

Model Recommendations by Use Case

Use CaseRecommended ModelWhy
Complex toolsClaude 3.5 SonnetBest at multi-step tool use
E-commerceGPT-4oFast, accurate product handling
Simple lookupsGPT-4o-miniCost-effective
Privacy-criticalOllama (Llama 3.2)Local, no data leaves server

Tool Execution Flow

User Message

AI analyzes request

AI decides to use tool

Ansa executes tool
    ├── HTTP: Makes API request
    ├── Form: Returns schema to widget
    └── Mock: Returns templated response

Result returned to AI

AI generates natural response

Response + rich display sent to user

Enabling/Disabling Tools

Toggle tools on/off without deleting them:
  • Enabled — AI can use this tool
  • Disabled — Tool is hidden from AI
Useful for:
  • Seasonal tools (holiday promotions)
  • A/B testing different tools
  • Temporarily disabling broken integrations

Tool Categories

Organize your tools by purpose:
CategoryExamples
Data LookupProduct search, order status, user info
FormsContact, lead capture, surveys
ActionsCreate ticket, send notification
DisplayShow pricing table, feature comparison

Next Steps

See Also