Skip to main content

Overview

Tools are custom functions that give your agents the ability to interact with external services. When a user asks your agent to do something that requires external data or actions, the agent can call a tool to fulfill the request.
Tools work with both agent types. You can attach tools to Single-Use agents and Permanent agents. The tool definitions are always stored in your account and managed via the dashboard or API.

How Tools Work

  1. You define the tool - Name, description, parameters schema, and your webhook URL
  2. You attach it to an agent - Via dashboard or API
  3. Agent decides when to call it - Based on the conversation and your tool’s description
  4. Your webhook executes - Receives the parameters, performs the action, returns a response
  5. Agent uses the response - Incorporates the data into its reply

Tool Configuration

Each tool consists of:

Example Tool Definition


Webhook Request Format

When the agent calls your tool, your webhook receives a POST request with:
Your webhook should return JSON:
Your webhook must respond within the timeout. If your webhook takes too long, the tool call will fail and the agent will tell the user it couldn’t complete the action. Default timeout is 20 seconds.

Writing Good Tool Descriptions

The description field is critical—it tells the agent when to use the tool. Write descriptions that: Do:
  • Explain what the tool does in plain language
  • Mention trigger phrases users might say
  • Specify what information the tool provides
Don’t:
  • Be vague (“Does stuff with data”)
  • Assume the agent knows your business context

Examples


Parameters Schema

Tools use JSON Schema to define their parameters. The agent uses this schema to extract the right information from the conversation.

Basic Types

Enum Values

Nested Objects


Attaching Tools to Agents

Via Dashboard

  1. Go to dashboard.iwy.ai
  2. Create or edit an agent
  3. In the “Tools” section, select the tools you want to attach

Via API (Permanent Agents)

When creating or updating a permanent agent, include the tool IDs:

Via API (Single-Use Agents)

Single-use agents can also use tools by including the tool IDs in the configuration:

Testing Tools

Before attaching a tool to an agent, test it to make sure your webhook is working correctly:
The response shows exactly what was sent to your webhook and what it returned:
You can also validate parameters without calling your webhook:

Common Use Cases


Error Handling

If your webhook returns an error or times out, the agent will gracefully handle it: Your webhook can return error details that the agent can communicate:

Security Best Practices

Your webhook URL is called from iwy’s servers, not the user’s browser. This means you can trust the request, but you should still validate it.
  1. Use authentication headers - Add an API key in the headers configuration
  2. Validate the tool_id - Confirm it matches your expected tool
  3. Validate parameters - Don’t trust that parameters are well-formed
  4. Use HTTPS - Always use encrypted connections
  5. Limit permissions - Your webhook should only do what’s necessary

Quick Reference


Support

Need help? Contact us