LiveKit docs › Build Agents › Prebuilt components › Prebuilt tools › EndCallTool

---

# EndCallTool

> Provide your agent with a tool that gracefully ends the call and disconnects from the room.

Available in (BETA):
- [x] Node.js
- [x] Python

## Overview

Use `EndCallTool` to provide your agent with a tool that gracefully ends the call and disconnects from the room. The tool automatically handles cleanup, including optionally deleting the room and shutting down the session.

When the `end_call` tool is called:

1. The agent generates a final response (based on `end_instructions`).
2. The session shuts down after the response is complete.
3. If `delete_room` is `True`, the room is deleted, disconnecting all participants.
4. The job process shuts down.

### Basic usage

Add `EndCallTool` (Python) or `beta.createEndCallTool()` (Node.js) to your agent's tools:

**Python**:

```python
from livekit.agents.beta.tools import EndCallTool
from livekit.agents import Agent

class CustomerServiceAgent(Agent):
    def __init__(self):
        end_call_tool = EndCallTool()
        super().__init__(
            instructions="You are a helpful customer service agent.",
            tools=end_call_tool.tools,
        )

```

---

**Node.js**:

```typescript
import { beta, voice } from '@livekit/agents';

const customerServiceAgent = voice.Agent.create({
  instructions: 'You are a helpful customer service agent.',
  tools: [beta.createEndCallTool()],
});

```

The LLM automatically has access to the `end_call` tool and can use it when the conversation is complete.

### Custom implementation

By default, `EndCallTool` uses generic instructions for when and how to end the call. The following example customizes the tool with `extra_description` and `end_instructions` so the agent only ends the call after confirming the customer's issue is resolved and says a custom goodbye message.

**Python**:

```python
from livekit.agents.beta.tools import EndCallTool
from livekit.agents import Agent

class SupportAgent(Agent):
    def __init__(self):
        end_call_tool = EndCallTool(
            extra_description="Only end the call after confirming the customer's issue is resolved.",
            delete_room=True,
            end_instructions="Thank the customer for their time and wish them a good day.",
        )
        super().__init__(
            instructions="You are a technical support agent. Help resolve customer issues.",
            tools=end_call_tool.tools,
        )

```

---

**Node.js**:

```typescript
import { beta, voice } from '@livekit/agents';

const supportAgent = voice.Agent.create({
  instructions: 'You are a technical support agent. Help resolve customer issues.',
  tools: [
    beta.createEndCallTool({
      extraDescription: "Only end the call after confirming the customer's issue is resolved.",
      deleteRoom: true,
      endInstructions: 'Thank the customer for their time and wish them a good day.',
    }),
  ],
});

```

### Parameters

For a full list of Python parameters, see the [EndCallTool reference](https://docs.livekit.io/reference/python/livekit/agents/beta/tools/index.html.md#livekit.agents.beta.tools.EndCallTool). In Node.js, pass camelCase options to `beta.createEndCallTool(...)`.

- **`extra_description`** _(string)_ (optional): Additional description to add to the end call tool description. Useful for providing context-specific instructions.

- **`delete_room`** _(bool)_ (optional) - Default: `True`: Whether to delete the room when the call ends. Deleting the room disconnects all remote users, including SIP callers.

- **`end_instructions`** _(string)_ (optional) - Default: `say goodbye to the user`: Tool output to the LLM for generating the tool response. This is the message the LLM receives after the tool is called.

- **`on_tool_called / onToolCalled`** _(Callable)_ (optional): Callback invoked when the end-call tool is called.

- **`on_tool_completed / onToolCompleted`** _(Callable)_ (optional): Callback invoked after the end-call tool completes.

---

This document was rendered at 2026-10-07T15:33:56.586Z.
For the latest version of this document, see [https://docs.livekit.io/agents/prebuilt/tools/end-call-tool.md](https://docs.livekit.io/agents/prebuilt/tools/end-call-tool.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).