Agent Tools
Create tool
Adding Agent Tools to Duckie
Steps
To create an Agent Tool:
- Create an API endpoint – Define endpoints for data retrieval or processing (e.g. using FastAPI).
- Deploy the API – Make it publicly accessible using Docker, Railway, Fly.io, AWS, or your preferred hosting service.
- Add it to Duckie’s Agent Tools – Register the API in Duckie’s Agent Tools.
- Add to a Workflow – Put the Agent Tool as a node in your workflow. Duckie will invoke it when handling tickets, based on the workflow logic you’ve set.
For a live demo of creating a new Agent Tool, see the following Loom Video.
Example: Build and Deploy an API Wrapper for Datadog
- Create the API wrappers
- Retrieve a container ID using a
caller_id
. - Fetch logs based on the container ID, filtering with specific keywords.
- Retrieve a container ID using a
- Deploy the API for external use and expose it publicly.
1. Setup and Prerequisites
Install Dependencies
Ensure you have Python installed, then install the required packages:
3. Deploying the API
Option 1: Deploy with Docker
Create a Dockerfile
:
Build and run locally:
Option 2: Deploy on Railway or Fly.io (Easiest)
For Railway:
For Fly.io:
Option 3: Deploy on AWS with API Gateway for Public Access
- Deploy FastAPI as an AWS Lambda function with API Gateway.
- Use
Mangum
to convert FastAPI into an AWS Lambda-compatible app. - Open API Gateway settings and enable public access.
Modify api.py:
Then deploy using AWS SAM or Terraform.
4. Add it to Duckie’s Agent Tools
Once your API is live, register it as an Agent Tool in Duckie by filling out the following fields:
- Name – A clear name for the tool (e.g. “Stripe Refund Processor”, “Datadog Log Fetcher”).
- Approval Required? – Check this if you want the tool’s output to require manual approval before Duckie can use it. If yes, Duckie will send an internal note in Zendesk/Intercom to the admin asking for approval, and then proceed to execute the API call after receiving confirmation.
- Description – Describe what the tool does and when it should be used.
- Endpoint – The full URL of your API endpoint.
- Method – The HTTP method used to call the API (e.g. GET, POST).
- Headers – Any headers Duckie should include in the request (e.g. API keys).
- Parameter List – The parameters Duckie should pass when calling the API (e.g.
customer_id
,order_id
).
Once configured, your Agent Tool can be added to workflows to let Duckie invoke it as part of handling tickets.
5. Add to Workflow
After creating your Agent Tool, you can add it as a node in any Duckie workflow. This allows Duckie to automatically call the tool at the right moment during ticket handling.
When adding to a workflow:
- Choose the custom node type in the workflow builder.
- Select the specific tool you registered.
- [Optional] Map variables or outputs from earlier nodes (e.g.
customer_id
,order_id
) to the tool’s parameters. - Define what happens next based on the tool’s response (e.g. send a message, trigger another tool, escalate).