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
- You define the tool - Name, description, parameters schema, and your webhook URL
- You attach it to an agent - Via dashboard or API
- Agent decides when to call it - Based on the conversation and your tool’s description
- Your webhook executes - Receives the parameters, performs the action, returns a response
- 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:Writing Good Tool Descriptions
Thedescription 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
- 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
- Go to dashboard.iwy.ai
- Create or edit an agent
- 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: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
- Use authentication headers - Add an API key in the
headersconfiguration - Validate the tool_id - Confirm it matches your expected tool
- Validate parameters - Don’t trust that parameters are well-formed
- Use HTTPS - Always use encrypted connections
- Limit permissions - Your webhook should only do what’s necessary