Introduction

Function calling transforms your AI agent from a conversational interface into an action-oriented assistant. By connecting your agent to functions, you enable it to interact with external systems, manage call flows, and perform real-world tasks.

Common Use Cases

Function calling enables your agent to:

Call Management

  • Transfer calls: Route to human agents or other departments
  • End calls: Gracefully terminate conversations
  • Send DTMF tones: Navigate phone menus

Business Operations

  • Book appointments: Integrate with scheduling systems
  • Check availability: Query calendars or inventory
  • Process orders: Create, modify, or cancel orders

Data Integration

  • Retrieve information: Pull data from CRMs, databases, or APIs
  • Update records: Modify customer information or case details
  • Send notifications: Trigger emails, SMS, or push notifications

How Function Calling Works

The Process

  1. Agent Decision: Based on the conversation context, the LLM determines when a function is needed
  2. Parameter Extraction: The agent extracts required information from the conversation
  3. Function Execution: Retell calls your function with the extracted parameters
  4. Response Handling: The function result is processed and incorporated into the conversation

Technical Overview

Function calling uses structured JSON to communicate between the LLM and your systems:
{
  "function": "book_appointment",
  "arguments": {
    "date": "2024-03-15",
    "time": "14:00",
    "customer_name": "John Smith"
  }
}

Additional Resources

Configuring Tool Calls

Dashboard Configuration

Access and manage tools in the agent detail page under the “Functions” section.
Functions section in dashboard

Available Function Types

1. Pre-built Functions

Retell provides ready-to-use functions for common scenarios:
FunctionPurposeCommon Use Cases
End CallTerminate conversation gracefullyAfter completing tasks, when caller requests
Transfer CallRoute to human agentsEscalation, department routing
Press DigitsSend DTMF tonesNavigate IVR systems, enter codes
Check AvailabilityQuery available time slotsAppointment scheduling
Book CalendarCreate calendar eventsConfirm appointments, meetings
Send SMSSend text messagesConfirmations, follow-ups

2. Custom Functions

Create your own functions to:
  • Integrate with your APIs: Connect to CRM, ERP, or custom systems
  • Execute business logic: Validate data, calculate prices, check inventory
  • Trigger workflows: Start processes in other systems

Custom Function Features

  • Flexible parameters: Define any input structure
  • Async execution: Run in background without blocking conversation
  • Error handling: Graceful fallbacks for failures
  • Response control: Customize what the agent says during/after execution
Learn more about custom functions →

Video Tutorial

Additional Resources