Agent Tools: Give Your AI Assistant Superpowers

Agent Tools let your AI assistant interact with external systems in real-time. Instead of just responding from its training data and knowledge base, your assistant can call APIs, check order statuses, look up customer records, and perform actions — all during a conversation.

Think of it as giving your AI assistant hands. It can now reach out to your databases, CRM, inventory system, or any web service to get live data and take action on behalf of your customers.

What Are Agent Tools?

An Agent Tool is a configured API endpoint (or MCP server) that your AI assistant can call during conversations. You define:

  • What the tool does — so the AI knows when to use it
  • How to call it — the API endpoint, method, headers, and body
  • What to do with the response — instructions for how the AI should interpret and present the results

Accessing Agent Tools

  1. Open your Workspace
  2. Go to Integrations in the sidebar
  3. Click AI Assistants
  4. Open an assistant and go to the External Tools tab

Tool Types

API Endpoint

Connect to any REST API. Configure the HTTP method, URL, headers, request body, and authentication. This is the most common tool type and works with virtually any web service.

Table Query

Connect your assistant to a Dynamic Table from your Knowledge Base. The assistant can query structured data (orders, products, inventory, scriptures, etc.) using natural language or SQL. Behind the scenes, the SQL is validated for safety and translated to a MongoDB query for execution.

Table tools support:

  • Manual SQL mode — You write the SQL query, and it gets validated and translated automatically
  • AI-generated mode — Describe what you want in plain English, and the AI writes the SQL for you
  • Parameterized queries — Use template variables like {{status}} that get filled from the conversation
  • Safe execution — All queries are validated to prevent destructive operations (INSERT, UPDATE, DELETE, DROP are blocked)
  • Loading messages — Show a custom message to visitors while the tool fetches data

MCP Server (Coming Soon)

Model Context Protocol servers will allow standardized tool connections. Support is planned for a future release.

Creating a Tool

Basic Information

  • Tool Name — A unique identifier using lowercase letters, numbers, and underscores (e.g., get_order_status, lookup_customer). This is how the AI identifies the tool.
  • Description — A clear explanation of what this tool does. This is sent to the AI model, so write it in a way that helps the AI decide when to use the tool. Be specific about what inputs it expects and what it returns.
  • Response Instructions — Optional guidance for how the AI should interpret and present the API response. For example: "Format the temperature in Celsius and mention the current weather condition."

API Configuration (API Endpoint tools)

  • HTTP Method — GET, POST, PUT, PATCH, or DELETE
  • URL — The full endpoint URL (can include variables like {{order_id}})
  • Headers — Custom HTTP headers (e.g., Authorization: Bearer *** Content-Type: application/json`)
  • Request Body — The JSON body to send with POST/PUT/PATCH requests. Can include variables from the conversation.

Table Configuration (Table Query tools)

  • Dynamic Table — Select which Dynamic Table to query
  • Query Mode — Choose between manual SQL or AI-generated
  • SQL Query — The SELECT query to execute (manual mode)
  • Query Description — Describe what you want in plain English (AI-generated mode)
  • Parameters — Define input parameters that the AI can pass during conversations

Permission Levels

Control who can use this tool:

  • Read Only — The tool can fetch data but not modify anything
  • Write — The tool can create or update data
  • Admin — Full access including deletion

Authentication (API Endpoint tools)

Choose how the tool authenticates with the external service:

  • None — No authentication required
  • Bearer Token — Send an `Authorization: Bearer *** header
  • API Key — Send a custom header with your API key
  • Basic Auth — Username and password authentication

Throttling

Control how often a tool can be called per visitor:

  • Throttle Limit — Maximum number of calls per period
  • Throttle Period — Hourly or daily

Testing Your Tools

Before enabling a tool for your AI assistant, you should test it:

  1. Configure the tool with your API details
  2. Use the Test feature to send a sample request
  3. Review the response to make sure it's returning the expected data
  4. Adjust the response instructions if the AI needs more guidance on interpreting the results

Testing Table Tools

Table tools have a dedicated Validate & Test workflow:

  1. Write your SQL query or description
  2. Click Validate — the system checks the SQL for safety and generates the MongoDB translation
  3. Click Test — runs the validated query against your actual table data
  4. Review the results and latency

The validation step ensures your query is safe (SELECT only) and correctly maps to your table schema. If validation fails, you'll get a clear error message with a suggested fix.

How Tools Work in Conversations

When a visitor asks your AI assistant a question that matches a tool's description:

  1. The AI recognizes that a tool might be needed
  2. It constructs the API call using conversation context (e.g., the order number the visitor mentioned)
  3. It sends the request and receives the response
  4. It interprets the response using your instructions
  5. It crafts a natural-language reply to the visitor

For example, if a visitor asks "Where is my order #12345?" and you have a get_order_status tool, the AI will call your API with order ID 12345, get the shipping status, and tell the visitor exactly where their package is.

For table tools, the AI automatically builds the appropriate query parameters from the conversation and executes the pre-validated query.

Best Practices

  • Write clear descriptions — The AI uses the description to decide when to call the tool. Be specific: "Check the status of an order by order ID. Returns shipping status, estimated delivery date, and tracking number."
  • Use response instructions — Raw API responses can be technical. Tell the AI how to translate them into customer-friendly language.
  • Start with read-only tools — Begin with tools that fetch data before enabling tools that modify records. This reduces risk while you're testing.
  • Test thoroughly — Use the test feature to verify your tool works with real data before enabling it for live conversations.
  • Keep tools focused — Each tool should do one thing well. Instead of a single "do everything" endpoint, create separate tools for order lookup, customer info, and product search.
  • Secure your endpoints — Use authentication to protect your APIs. Never expose admin-level tools without proper permission controls.
  • Validate table queries — Always validate SQL queries before saving table tools to ensure they execute correctly against your data.

Related

See Also

  • Test file: tests/Feature/Models/AgentToolTest.php
  • Test file: tests/Feature/Livewire/AgentTablesTableTest.php
  • Test file: tests/Feature/Tools/TableToolAdapterTest.php

Keywords

agent tools, external tools, API integration, AI tools, function calling, tool use, AI assistant tools, real-time data, API endpoints, MCP server, table query, dynamic table, SQL query, tool testing