Overview
Voice agents can be enhanced with tools that enable advanced functionality during calls:
End calls gracefully when objectives are met
Transfer calls to human agents or phone numbers
Integrate with external APIs (CRM, databases, etc.)
Book appointments via Cal.com
Send SMS messages during calls
Transfer to other AI agents for specialized handling
Extract and save conversation data
Navigate IVR systems with DTMF
And more!
Tools are only supported for voice agents . SMS agents do not support tools.
Authentication
Path Parameters
The unique identifier of the voice agent to update
Request Body
Array of tool configurations. Each tool must have type, name, and type-specific fields.
1. End Call
End the conversation gracefully when objectives are met.
{
"type" : "end_call" ,
"name" : "end_conversation" ,
"description" : "End the call when the customer's questions are answered"
}
Unique tool name (snake_case, a-z, 0-9, underscores only)
What the tool does and when to use it
2. Transfer Call
Transfer the call to a human agent or phone number.
Cold Transfer
Warm Transfer
Transfer with Extension
{
"type" : "transfer_call" ,
"name" : "transfer_to_support" ,
"description" : "Transfer to human support team when user requests assistance" ,
"transfer_destination" : {
"type" : "predefined" ,
"number" : "+15551234567"
},
"transfer_option" : {
"type" : "cold_transfer"
}
}
Where to transfer the call Properties:
type: Must be "predefined"
number: Phone number in E.164 format (e.g., "+15551234567")
extension (optional): Extension digits (e.g., "123")
How to transfer the call Properties:
type: "cold_transfer" (immediate) or "warm_transfer" (AI introduces)
on_hold_music (warm only): "none", "relaxing_sound", "uplifting_beats", "ringtone"
show_transferee_as_caller (optional): Show caller’s number to transfer destination
3. Custom API Integration
Integrate with any external API (CRM, databases, order systems, etc.)
GET Request
POST Request
With Query Params
{
"type" : "custom" ,
"name" : "check_order_status" ,
"description" : "Check order status in CRM when customer provides order number" ,
"url" : "https://api.yourcrm.com/orders/{{order_id}}" ,
"method" : "GET" ,
"headers" : {
"Authorization" : "Bearer YOUR_API_KEY"
},
"speak_after_execution" : true
}
API endpoint URL. Supports dynamic variables: {{variable_name}}
HTTP method: "GET", "POST", "PUT", "PATCH", or "DELETE"
HTTP headers (e.g., authorization, content-type)
Query parameters to append to URL
Whether AI should speak the result after API call completes
4. Check Calendar Availability (Cal.com)
Check available time slots in Cal.com calendar.
{
"type" : "check_availability_cal" ,
"name" : "check_doctor_availability" ,
"description" : "Check available appointment slots for doctor" ,
"cal_api_key" : "cal_live_xxxxxxxxxxxx" ,
"event_type_id" : 60444 ,
"timezone" : "America/Los_Angeles"
}
Cal.com API key (get from Cal.com dashboard → Settings → Developer → API Keys)
Cal.com event type ID (found in event type URL)
IANA timezone (e.g., "America/New_York", "Europe/London"). If not specified, uses caller’s timezone or server default.
5. Book Appointment (Cal.com)
Book appointments directly via Cal.com.
{
"type" : "book_appointment_cal" ,
"name" : "book_consultation" ,
"description" : "Book a 30-minute consultation appointment" ,
"cal_api_key" : "cal_live_xxxxxxxxxxxx" ,
"event_type_id" : 60444 ,
"timezone" : "America/New_York"
}
IANA timezone for booking
6. Agent Transfer
Transfer conversation to another AI agent (not a phone transfer).
{
"type" : "agent_swap" ,
"name" : "transfer_to_booking_agent" ,
"description" : "Transfer to specialized booking agent" ,
"agent_id" : "agent_xxxxxxxxxxxxxxxxxx" ,
"post_call_analysis_setting" : "both_agents"
}
ID of the target AI agent to transfer to
post_call_analysis_setting
"both_agents" or "only_destination_agent"
Specific version of target agent. If not specified, uses latest.
Agent Transfer vs Phone Transfer : Agent transfer switches AI handlers instantly with full conversation history, while phone transfer creates a new phone call. Agent transfer is faster and more reliable.
7. Send SMS
Send one-way SMS message during voice call.
Predefined Message
AI-Generated Message
{
"type" : "send_sms" ,
"name" : "send_confirmation" ,
"description" : "Send appointment confirmation via text" ,
"sms_content" : {
"type" : "predefined" ,
"content" : "Your appointment is confirmed for {{appointment_date}} at {{appointment_time}}. See you soon!"
}
}
SMS message configuration For predefined messages:
type: "predefined"
content: The message text (supports dynamic variables like {{name}})
For AI-generated messages:
type: "inferred"
prompt: Instructions for AI to generate the message
SMS tools only work for phone numbers with SMS capability enabled.
Extract and save conversation data as variables for later use.
{
"type" : "extract_dynamic_variable" ,
"name" : "extract_customer_info" ,
"description" : "Extract customer name, phone, and email from conversation" ,
"variables" : [
{
"type" : "string" ,
"name" : "customer_name" ,
"description" : "The customer's full name"
},
{
"type" : "string" ,
"name" : "customer_email" ,
"description" : "The customer's email address"
},
{
"type" : "enum" ,
"name" : "interest_level" ,
"description" : "Customer's interest level" ,
"choices" : [ "high" , "medium" , "low" ]
}
]
}
Variables to extract. Each variable has:
type: "string", "number", "enum", or "boolean"
name: Variable name (snake_case)
description: What to extract
choices (for enum): Array of possible values
examples (optional): Example values to guide AI
9. Press Digit (DTMF)
Press phone keypad digits for IVR navigation.
{
"type" : "press_digit" ,
"name" : "press_1_for_sales" ,
"description" : "Press 1 to navigate to sales department" ,
"delay_ms" : 1000
}
Delay in milliseconds before pressing digit (default: 1000ms, max: 5000ms)
Useful for navigating automated phone systems and IVR menus.
10. MCP (Model Context Protocol)
Connect to MCP servers for advanced integrations.
{
"type" : "mcp" ,
"name" : "inventory_lookup" ,
"description" : "Check inventory via MCP server" ,
"mcp_id" : "mcp_xxxxxxxxxxxx"
}
Unique ID of the MCP server configuration
MCP tools require prior MCP server configuration. Contact support for setup assistance.
Request Examples
curl -X PATCH "https://api.teli.ai/v1/agents/1763763759612x739630924151608142/tools" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tools": [
{
"type": "end_call",
"name": "end_conversation",
"description": "End the call when objectives are completed"
}
]
}'
{
"tools" : [
{
"type" : "custom" ,
"name" : "check_order_status" ,
"description" : "Check customer order status in CRM" ,
"url" : "https://api.yourcrm.com/orders/{{order_id}}" ,
"method" : "GET" ,
"headers" : {
"Authorization" : "Bearer YOUR_CRM_API_KEY"
},
"speak_after_execution" : true
},
{
"type" : "transfer_call" ,
"name" : "transfer_to_support" ,
"description" : "Transfer to human support if customer is frustrated" ,
"transfer_destination" : {
"type" : "predefined" ,
"number" : "+15551234567"
},
"transfer_option" : {
"type" : "warm_transfer"
}
},
{
"type" : "send_sms" ,
"name" : "send_order_tracking" ,
"description" : "Send order tracking link via SMS" ,
"sms_content" : {
"type" : "predefined" ,
"content" : "Your order {{order_id}} is on the way! Track it here: {{tracking_url}}"
}
},
{
"type" : "end_call" ,
"name" : "end_call" ,
"description" : "End the call after helping customer"
}
]
}
Healthcare Appointment Example
{
"tools" : [
{
"type" : "check_availability_cal" ,
"name" : "check_appointment_slots" ,
"description" : "Check available appointment slots with Dr. Smith" ,
"cal_api_key" : "cal_live_xxxxxxxxxxxx" ,
"event_type_id" : 60444 ,
"timezone" : "America/Los_Angeles"
},
{
"type" : "book_appointment_cal" ,
"name" : "book_appointment" ,
"description" : "Book the appointment after customer confirms time" ,
"cal_api_key" : "cal_live_xxxxxxxxxxxx" ,
"event_type_id" : 60444 ,
"timezone" : "America/Los_Angeles"
},
{
"type" : "send_sms" ,
"name" : "send_appointment_confirmation" ,
"description" : "Send appointment confirmation via text" ,
"sms_content" : {
"type" : "predefined" ,
"content" : "Your appointment with Dr. Smith is confirmed for {{appointment_date}} at {{appointment_time}}. Reply CANCEL to cancel."
}
},
{
"type" : "transfer_call" ,
"name" : "transfer_to_nurse" ,
"description" : "Transfer to nurse for medical questions" ,
"transfer_destination" : {
"type" : "predefined" ,
"number" : "+15559876543"
},
"transfer_option" : {
"type" : "warm_transfer"
}
},
{
"type" : "end_call" ,
"name" : "end_call" ,
"description" : "End call after appointment is booked"
}
]
}
Sales Bot Example
{
"tools" : [
{
"type" : "custom" ,
"name" : "check_inventory" ,
"description" : "Check product inventory and pricing" ,
"url" : "https://api.yourstore.com/inventory/{{product_sku}}" ,
"method" : "GET" ,
"headers" : {
"Authorization" : "Bearer YOUR_API_KEY"
},
"speak_after_execution" : true
},
{
"type" : "custom" ,
"name" : "create_quote" ,
"description" : "Generate price quote for customer" ,
"url" : "https://api.yourcrm.com/quotes" ,
"method" : "POST" ,
"headers" : {
"Authorization" : "Bearer YOUR_API_KEY" ,
"Content-Type" : "application/json"
},
"speak_after_execution" : true
},
{
"type" : "send_sms" ,
"name" : "send_quote" ,
"description" : "Text the quote to customer" ,
"sms_content" : {
"type" : "predefined" ,
"content" : "Thanks for your interest! Your quote: {{quote_amount}}. Questions? Call us at +15551234567"
}
},
{
"type" : "transfer_call" ,
"name" : "transfer_to_sales_rep" ,
"description" : "Transfer to human sales representative for closing" ,
"transfer_destination" : {
"type" : "predefined" ,
"number" : "+15551234567"
},
"transfer_option" : {
"type" : "warm_transfer"
}
},
{
"type" : "end_call" ,
"name" : "end_call" ,
"description" : "End call after quote sent or sale completed"
}
]
}
Response
Success Response
{
"success" : true ,
"agent_id" : "1763763759612x739630924151608142" ,
"tools_count" : 5 ,
"message" : "Agent tools updated successfully" ,
"powered_by" : "Teli"
}
Indicates successful update
The agent’s unique identifier
Number of tools configured
Error Responses
404 - Agent Not Found
400 - Not Voice Agent
400 - No Voice Configuration
500 - Update Failed
{
"error" : "Agent not found" ,
"success" : false ,
"powered_by" : "Teli"
}
Tool names must follow these rules:
Lowercase letters only (a-z)
Numbers allowed (0-9)
Underscores allowed (_)
No spaces
No special characters
Maximum 64 characters
Examples:
✅ "end_call"
✅ "transfer_to_support"
✅ "check_order_status"
❌ "Transfer to Support" (spaces, capitals)
❌ "check-order" (hyphen not allowed)
❌ "send SMS!" (space, special char)
Our platform auto-sanitizes names , but following this format ensures consistency.
Dynamic Variables
Many tools support dynamic variables that get substituted at runtime from the conversation:
Using Dynamic Variables
SMS with Variables
{
"type" : "custom" ,
"name" : "lookup_customer" ,
"url" : "https://api.crm.com/customers/{{customer_phone}}" ,
"method" : "GET" ,
"headers" : {
"Authorization" : "Bearer {{api_key}}"
},
"speak_after_execution" : true
}
Common variables:
{{first_name}}, {{last_name}}, {{customer_name}}
{{phone_number}}, {{email}}
{{order_id}}, {{appointment_date}}, {{appointment_time}}
Custom variables extracted during conversation
Best Practices
Write clear descriptions that tell the AI when to use the tool:
Good Description
Bad Description
{
"type" : "transfer_call" ,
"name" : "transfer_to_support" ,
"description" : "Transfer to human support ONLY if customer explicitly asks to speak with a person, or if they are frustrated and escalating"
}
Combine tools for powerful workflows:
Support Bot :
check_order_status (Custom API)
transfer_to_support (Transfer)
end_call (End Call)
Booking Bot :
check_availability_cal (Check Calendar)
book_appointment_cal (Book Appointment)
send_confirmation (Send SMS)
end_call (End Call)
Sales Bot :
check_inventory (Custom API)
create_quote (Custom API)
send_quote (Send SMS)
transfer_to_sales_rep (Transfer)
end_call (End Call)
3. Error Handling
Tools can timeout or fail. Include fallback instructions in your agent prompt:
If the check_order_status tool fails or times out, apologize and offer to transfer
to a human representative who can help.
Use descriptive, action-oriented names:
✅ check_order_status
✅ book_appointment
✅ transfer_to_support
❌ tool1
❌ api_call
❌ function
Common Use Cases
Customer Support
{
"tools" : [
{ "type" : "custom" , "name" : "check_account_status" , ... },
{ "type" : "custom" , "name" : "update_customer_info" , ... },
{ "type" : "send_sms" , "name" : "send_ticket_number" , ... },
{ "type" : "transfer_call" , "name" : "transfer_to_specialist" , ... },
{ "type" : "end_call" , "name" : "end_call" , ... }
]
}
Healthcare
{
"tools" : [
{ "type" : "check_availability_cal" , "name" : "check_doctor_slots" , ... },
{ "type" : "book_appointment_cal" , "name" : "book_appointment" , ... },
{ "type" : "send_sms" , "name" : "send_confirmation" , ... },
{ "type" : "transfer_call" , "name" : "transfer_to_nurse" , ... },
{ "type" : "end_call" , "name" : "end_call" , ... }
]
}
Sales & Lead Qualification
{
"tools" : [
{ "type" : "custom" , "name" : "check_pricing" , ... },
{ "type" : "custom" , "name" : "check_inventory" , ... },
{ "type" : "extract_dynamic_variable" , "name" : "save_lead_info" , ... },
{ "type" : "send_sms" , "name" : "send_brochure_link" , ... },
{ "type" : "transfer_call" , "name" : "transfer_to_sales" , ... },
{ "type" : "end_call" , "name" : "end_call" , ... }
]
}
Appointment Scheduling
{
"tools" : [
{ "type" : "check_availability_cal" , "name" : "check_slots" , ... },
{ "type" : "book_appointment_cal" , "name" : "book_slot" , ... },
{ "type" : "send_sms" , "name" : "send_calendar_invite" , ... },
{ "type" : "end_call" , "name" : "end_call" , ... }
]
}
Response Examples
Successful Update
{
"success" : true ,
"agent_id" : "1763763759612x739630924151608142" ,
"tools_count" : 4 ,
"message" : "Agent tools updated successfully" ,
"powered_by" : "Teli"
}
Error: Not a Voice Agent
{
"error" : "Tools are only supported for voice agents" ,
"success" : false ,
"powered_by" : "Teli"
}
Tools are only available for voice agents. SMS agents use different mechanisms for automation.
Error: Agent Not Found
{
"error" : "Agent not found" ,
"success" : false ,
"powered_by" : "Teli"
}
500 - Configuration Error
{
"error" : "Failed to update agent tools" ,
"success" : false ,
"powered_by" : "Teli"
}
Check tool names follow naming requirements (snake_case, no spaces). Our API auto-sanitizes names, but proper formatting helps prevent issues.
POST /v1/agents
{
"agent_type" : "voice",
"agent_name" : "Support Bot",
"prompt" : "You are a helpful support assistant...",
"voice_id" : "11labs-Adrian",
"language" : "en-US",
"general_tools" : [
{ "type" : "end_call", "name": "end_call", "description": "End the call"}
]
}
PATCH /v1/agents/{agent_id}/tools
{
"tools" : [
{ "type" : "end_call", ...},
{ "type" : "transfer_call", ...} ← Added new tool
]
}
GET /v1/agents/{agent_id}
→ Returns agent with "current_tools" array
Limitations & Notes
Important Limitations:
Voice agents only - SMS agents don’t support tools
Cal.com tools - Require Cal.com account and API key
Send SMS tool - Only works for numbers with SMS capability
Custom API tools - Your API must be publicly accessible or allow-list Teli IPs
Tool count - No hard limit, but keeping under 10 tools per agent improves AI performance
Performance Tips:
Fewer tools = Better AI performance - Only add tools you actually need
Clear descriptions - Help AI understand when to use each tool
Tool order doesn’t matter - AI selects appropriate tool based on conversation
Test thoroughly - Test each tool in various conversation scenarios
Advanced Features
Warm Transfer Options
Warm transfers support additional configuration:
{
"type" : "transfer_call" ,
"name" : "transfer_with_context" ,
"description" : "Transfer to sales with customer context" ,
"transfer_destination" : {
"type" : "predefined" ,
"number" : "+15551234567"
},
"transfer_option" : {
"type" : "warm_transfer" ,
"on_hold_music" : "uplifting_beats" ,
"show_transferee_as_caller" : true ,
"agent_detection_timeout_ms" : 30000
}
}
Music while caller is on hold:
"none" - No music
"relaxing_sound" - Calm background music
"uplifting_beats" - Energetic music
"ringtone" - Standard ringtone
show_transferee_as_caller
If true, shows caller’s number to transfer destination (requires telephony support)
agent_detection_timeout_ms
Maximum time to wait for human detection (default: 30000ms)
Custom API Advanced
{
"type" : "custom" ,
"name" : "process_payment" ,
"description" : "Process customer payment" ,
"url" : "https://api.yourpayments.com/charge" ,
"method" : "POST" ,
"headers" : {
"Authorization" : "Bearer YOUR_API_KEY" ,
"Content-Type" : "application/json"
},
"query_params" : {
"currency" : "USD"
},
"response_variables" : {
"transaction_id" : "data.transaction.id" ,
"receipt_url" : "data.receipt_url"
},
"speak_during_execution" : true ,
"speak_after_execution" : true ,
"execution_message_description" : "Say: Processing your payment now, one moment please" ,
"timeout_ms" : 10000
}
Extract values from API response as dynamic variables for later use.
Key: variable name, Value: JSON path in response
Whether AI speaks while API call is in progress
execution_message_description
What AI should say during execution (only if speak_during_execution: true)
API call timeout in milliseconds (1000-600000, default: 120000)
Test in Sandbox
Create test agent with tools
Make test calls
Trigger each tool
Verify behavior
Check logs for tool execution
View call logs to see which tools were triggered
Check call analysis for tool execution details
Review conversation transcripts for context
Troubleshooting
Problem : AI doesn’t use the tool during calls
Solutions :
Improve description - Be specific about when to use
Update prompt - Explicitly mention tool in agent prompt
Reduce tool count - Too many tools confuses AI
Test prompt - Include example scenario
Problem : Custom API tool returns errors
Solutions :
Verify URL - Check API endpoint is correct
Check headers - Ensure authorization is valid
Test endpoint - Call API directly to verify
Check timeout - Increase timeout_ms if needed
Transfer Fails
Problem : Call transfer doesn’t complete
Solutions :
Verify number - Check E.164 format (+15551234567)
Check telephony - Ensure transfer is supported
Try cold transfer - If warm transfer fails
Check extension - Validate extension digits
Rate Limits
No specific rate limits on tool updates, but:
Avoid updating same agent tools repeatedly in quick succession
Batch your tool changes (update all at once)
Cache tool configurations client-side when possible
Support
Need help with tools?
Ready to enhance your voice agents with powerful tools! 🚀