> ## Documentation Index
> Fetch the complete documentation index at: https://docs.persistence.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions and tools

> Let an agent act during a conversation.

Actions let an agent do more than speak. Add only the tools required for the workflow, give each one a narrow responsibility, and test its failure behavior before publishing.

## Built-in actions

| Action                       | Purpose                                                                                                             |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **End call**                 | End the current conversation when its goal is complete or a stop condition is met.                                  |
| **Transfer call**            | Transfer to a phone number, SIP URI, dynamic variable, or dynamically selected route using a cold or warm transfer. |
| **Extract dynamic variable** | Store a text, number, boolean, or fixed-choice value for later use.                                                 |
| **Capture input**            | Collect keypad input with an optional timeout, digit limit, and termination key.                                    |
| **Calendar**                 | Check availability, book, reschedule, or cancel through a connected calendar.                                       |
| **Custom function**          | Send an HTTP request to your service and use the response during the call.                                          |

## Configure a custom function

<Steps>
  <Step title="Define the contract">
    Give the function a lowercase snake\_case name and explain exactly when the agent should use it.
  </Step>

  <Step title="Configure the request">
    Choose the method and URL, then add headers, query parameters, and a JSON object schema for inputs.
  </Step>

  <Step title="Handle the response">
    Decide which fields should be stored as variables and what the agent should say before, during, or after execution. You can play a typing sound while it runs.
  </Step>

  <Step title="Test errors">
    Verify timeout, non-success response, missing field, and malformed-response behavior.
  </Step>
</Steps>

<Warning>
  Do not place credentials directly in prompts or tool configuration. Store encrypted values under **Settings → Secrets** and reference them through the supported configuration.
</Warning>

## Configure transfers

Choose a static destination or provide routing instructions for a dynamic destination. A destination can be a phone number, SIP URI, or supported dynamic variable.

* A **cold transfer** connects the destination without an agent debrief.
* A **warm transfer** lets the AI provide a debrief to the next agent.

Choose SIP invite or SIP refer according to your provider support. For SIP invite, configure the displayed caller ID and transfer ring duration. Add custom SIP headers only when the receiving system requires them.

## Capture keypad input

Set the expected digit count, termination key, prompt, timeout, confirmation behavior, and variable that stores the result. Test slow entry, early termination, invalid digits, and timeout.

## MCP servers

An agent can connect to an MCP server and expose selected MCP tools. Configure the server URL, headers, query parameters, and timeout, then choose the tools the agent may call. A workspace-global MCP can be available across agents; an agent-specific MCP stays scoped to that agent.

Treat an MCP server like any other privileged integration: grant the smallest useful tool set and verify its authentication and failure behavior.

## Calendar connections

Calendar actions require a connected Cal.com or Calendly account. Manage connections under **Integrations** before adding calendar actions to an agent.
