Tools allow your AI agent to execute actions by calling your webhooks. The LLM decides when to use a tool based on the conversation context, executes the call, and uses the result in its response.
import Zavudev from "@zavudev/sdk";const zavu = new Zavudev({ apiKey: process.env["ZAVUDEV_API_KEY"],});const tool = await zavu.senders.agent.tools.create("sender_abc123", { name: "check_order_status", description: "Look up the status and tracking information for a customer order. Use this when a customer asks about their order status, shipping, or delivery.", parameters: { type: "object", properties: { order_id: { type: "string", description: "The order ID (e.g., ORD-12345)", }, }, required: ["order_id"], }, webhookUrl: "https://api.yourcompany.com/webhooks/order-status", webhookSecret: "whsec_your_secret_here", // Optional});console.log("Tool created:", tool.id);
Customer: "Where is my order #12345?" | v +---------------+ | AI Agent | | Analyzes msg | +---------------+ | v +---------------+ | Decides to | | use tool | +---------------+ | v +---------------+ | Calls webhook | | with order_id | +---------------+ | v +---------------+ | Your Server | | Returns data | +---------------+ | v +---------------+ | AI formulates | | response | +---------------+ | vCustomer: "Your order #12345 shipped via FedEx and will arrive January 15th."
Look up the status and tracking information for a customer order.Use when the customer asks about their order status, shipping progress,delivery estimate, or tracking number. Requires the order ID whichtypically starts with "ORD-" followed by numbers.
Poor description:
Copy
Get order info.
Poor descriptions lead to tools being used incorrectly or not at all. Invest time in writing clear, detailed descriptions.