Skip to main content
Tools let your agent do more than answer questions — they let it take action. When a tool is configured, the LLM can decide to invoke it mid-conversation based on the user’s request. You define the tool’s parameters and behavior; the platform handles invocation and passes results back to the model.

Client tools

Executed in the user’s browser or app. Use these to trigger client-side actions like opening a modal, updating the UI, or logging an event.

Server tools

Executed on your backend via HTTP. Use these to read or write data, call third-party APIs, or run server-side logic.

MCP tools

Connect to Model Context Protocol servers. Use these to access entire toolsets exposed by an MCP-compatible service.

System tools

Built-in platform tools provided by XUNA AI. No configuration required beyond enabling them.

Client tools

Client tools run in the browser or native app. When the agent decides to call a client tool, it sends a tool-call event over the WebSocket or WebRTC connection. Your client-side code handles the event and returns a result. Use client tools for:
  • Opening a UI dialog or confirmation modal.
  • Navigating to a different page.
  • Reading local state (e.g., items in a cart).
  • Logging analytics events.
Define a client tool by specifying its name, description, and parameters. The description is what the LLM reads to decide when to invoke it.
client-tool-definition.json
{
  "name": "open_cart",
  "description": "Opens the shopping cart drawer so the user can review their items.",
  "parameters": {
    "type": "object",
    "properties": {}
  }
}
In your client code, register a handler for the tool. The handler’s return value is sent back to the agent as the tool result.
import { ConversationProvider } from "@xuna-ai/react";

<ConversationProvider
  clientTools={{
    open_cart: () => {
      openCartDrawer();
      return "Cart opened";
    },
  }}
>
  <Agent />
</ConversationProvider>

Server tools

Server tools execute on your backend. When the agent calls a server tool, the platform sends an HTTP POST request to your endpoint with the tool’s parameters. Your server processes the request and returns a result. Use server tools for:
  • Looking up order status from your database.
  • Creating a support ticket in an external system.
  • Sending an email or SMS.
  • Fetching real-time data like inventory or pricing.
Define a server tool with a name, description, parameters schema, and your endpoint URL:
server-tool-definition.json
{
  "name": "get_order_status",
  "description": "Looks up the status of a customer order by order ID.",
  "parameters": {
    "type": "object",
    "properties": {
      "order_id": {
        "type": "string",
        "description": "The customer's order ID."
      }
    },
    "required": ["order_id"]
  },
  "url": "https://api.yourapp.com/orders/status"
}
The platform sends a POST request with a JSON body:
tool-call-request.json
{
  "tool_name": "get_order_status",
  "parameters": {
    "order_id": "ORD-9821"
  }
}
Your endpoint should return a JSON object. The agent includes the response in its context before generating the next turn.
Server tool calls add latency equal to your endpoint’s response time. Keep server tools fast — aim for under 500ms. For slower operations, consider a pattern where the tool queues work and the agent tells the user it will follow up.

MCP tools

Model Context Protocol (MCP) is an open standard for connecting AI models to external toolsets. Connecting an MCP server gives your agent access to all the tools and resources that server exposes — without defining each one individually.
1

Get your MCP server URL

Obtain the URL of the MCP-compatible server you want to connect.
2

Add the MCP server to your agent

In the dashboard, go to ToolsMCP and enter the server URL and any required authentication headers.
3

Verify available tools

After connecting, the dashboard shows the list of tools discovered from the server. The agent can invoke any of them.

System tools

System tools are built into the XUNA AI platform. Enable them in the Tools tab without any code.
ToolDescription
End callTerminates the conversation gracefully.
Language detectionDetects the user’s language and switches ASR and TTS automatically.
Agent transferHands off the conversation to another XUNA AI agent.
Transfer to numberTransfers a phone call to a specified number (telephony only).
Skip turnInstructs the agent to wait silently for the next user input.
Play keypad touch tonePlays DTMF tones (useful for navigating phone menus).
Voicemail detectionDetects when a call reaches a voicemail system and responds accordingly.
Use the end call system tool in your system prompt instructions so the agent knows when to hang up. For example: “If the user says goodbye and the issue is resolved, use the end call tool.”