> For the complete documentation index, see [llms.txt](https://docs.agentalk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agentalk.io/ai-agents/agent-functions/use-built-in-functions.md).

# Use built-in functions

Agentalk includes three built-in functions you can add to any agent without external setup: **End Call**, **Update Contact**, and **Transfer Call**.

Each function runs based on a trigger condition you define in plain language.

### Before you start

You need the following before you begin:

* You have an agent created. See [**Create an agent**](/ai-agents/create-an-agent.md).
* For Transfer Call, you need a phone number connected to Agentalk and a destination number. See [**Add a phone number**](/phone-numbers/add-a-phone-number.md).
* For Update Contact, you need to know which contact field the agent will update. See [**Manage contacts**](/contacts/manage-contacts.md).

To configure functions:

1. Go to **AI Agents** in the left navigation.
2. Open the agent you want to configure.
3. Select the **Functions** tab.

<figure><img src="/files/09Nmbju4xobO2Gy4zEEm" alt=""><figcaption></figcaption></figure>

### Add the End Call function

Add the End Call function so the agent can end conversations cleanly.

1. In the **End Call Function** section, click **+ Add**.

<figure><img src="/files/9FUQHtEA11bE0NRJd1L4" alt=""><figcaption></figcaption></figure>

The function is added with no additional configuration.

{% hint style="info" %} <mark style="color:$info;">**Save your configuration changes**</mark>

Save your changes after adding the function.
{% endhint %}

The agent ends the call when:

* The conversation is completed.
* The caller asks to end the call, for example "bye".

You can edit or remove this function at any time.

### Add an Update Contact function

Add an Update Contact function to capture information from the conversation.

1. In the **Update Contact Function** section, click **+ Add**.
2. Configure the function:
   * **Function Name**: Generated automatically.
   * **Description**: Define when the agent should capture the data. Example: When the caller provides their email address.
   * **Fields to update**: Select one or more fields:
     * First Name
     * Last Name
     * Email
     * Phone
3. Click **Create Function**.

{% hint style="info" %} <mark style="color:$info;">**Save your configuration changes**</mark>

Save your changes after adding the function.
{% endhint %}

<figure><img src="/files/LgrQVAPGLiZgr50GhL2m" alt=""><figcaption></figcaption></figure>

The agent updates the selected fields when the condition is met.

{% hint style="warning" %} <mark style="color:$warning;">**Create custom fields before using them**</mark>

Custom fields must exist before the agent can write to them. Go to **Contacts** to create them before using this function.
{% endhint %}

You can add multiple Update Contact functions to capture different fields.

### Add a Transfer Call function

Add a Transfer Call function to hand off the call to a human agent or team.

1. In the **Transfer Functions** section, click **+ Add Transfer Function**.
2. Configure the function:
   * **Function Name**: Enter a name, for example `call_forwarding`.
   * **Description**: Define when the transfer should happen. Example: When the caller asks to speak with a human agent
3. In **Phone Number Settings**:
   * **Source number (Handover From)**: Select the current Agentalk number.
   * **Target number (Handover Target)**: Enter the destination number.<br>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><mark style="color:$info;"><strong>Understand source and target numbers</strong></mark></p><ul><li><strong>Source number</strong> is the number your agent uses to handle the call.</li><li><strong>Target number</strong> is the number where the call will be transferred.</li></ul></div>

     <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><mark style="color:$warning;"><strong>Make sure a phone number is configured</strong></mark></p><p>If no numbers are available, make sure you have configured a phone number in Agentalk before setting up the transfer.</p></div>
4. Click **+** **Add**.

{% hint style="info" %} <mark style="color:$info;">**Save your configuration changes**</mark>

Save your changes after adding the function.
{% endhint %}

<figure><img src="/files/HzSt7bfdAb9gp3ZAknHn" alt=""><figcaption></figcaption></figure>

When a transfer is triggered, the agent leaves the call and the caller continues with the destination number.

### Save and test your configuration

After adding or updating one or more functions, save your changes and verify that everything works correctly.

You can add multiple functions before saving.

* Click **Save draft** to keep changes without activating the agent.
* Click **Save** to apply the configuration.
* Click **Save and test agent** to run a test call.
* Click **Cancel** to discard changes.

### Next steps

Here are the recommended next steps after completing this guide:

* [**Connect external APIs as functions**](/ai-agents/agent-functions/connect-external-apis-as-functions.md): Add custom logic and retrieve external data during calls.
* [**Manage contacts**](/contacts/manage-contacts.md): Configure contact fields used by the Update Contact function.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.agentalk.io/ai-agents/agent-functions/use-built-in-functions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
