Back to all tools
Needs API key

Telegram on escalate

Uses the Telegram Bot API to send a message to your team chat. Pair it with escalate_to_human so humans get an immediate heads-up.

What this tool does

When the AI hands a conversation to a person, someone needs to notice quickly. This tool sends an alert to your team’s Telegram chat through the Telegram Bot API with the customer’s name, channel and a short summary. Pair it with escalate_to_human in your prompt so every handoff pings your team’s phones, even when nobody has the inbox open. You need a bot token from BotFather and your group’s chat ID.

Example conversation

Customer

I have been charged twice for my appointment. I want to speak to someone.

Tool callnotify_telegram_on_escalate

message: Double charge, customer wants a human

AI agent

I am sorry about that. I have alerted our billing team, and a person will reply here shortly.

Customer

How long will that take?

AI agent

They have been notified on their phones and usually reply within 15 minutes during opening hours.

Example only. Tool calls are shown so you can see when the agent uses this template. Your agent’s wording depends on your prompt and business information.

Who uses it

  • Small teams that coordinate on Telegram and want instant handoff alerts.
  • Clinics flagging urgent patient messages to the front desk.
  • Owners who want a ping when a high-value lead asks for a call.

Setup

  1. In Telegram, message @BotFather, create a bot, and copy the bot token.
  2. Add the bot to your team group (or start a chat with it). Get the chat ID (e.g. via @userinfobot or the getUpdates API).
  3. Replace YOUR_BOT_TOKEN in the Endpoint URL and YOUR_TELEGRAM_CHAT_ID in the request body.
  4. Add the prompt tip below so the agent notifies Telegram whenever it escalates.

Prompt tip

In your agent prompt, add: When you call escalate_to_human, also call notify_telegram_on_escalate with a short summary including the customer name, email, and reason.

Copy into custom tool form

Copy each value into the matching field when you add a custom tool on the create or edit agent page. Replace any YOUR_… placeholders with your real credentials.

Tool name

notify_telegram_on_escalate

Description

Send a Telegram message to the team when this conversation needs a human. Call this when escalating to a human, after collecting the customer name and email.

Endpoint URL

Paste into Endpoint URL (https:// is added automatically).

api.telegram.org/botYOUR_BOT_TOKEN/sendMessage

HTTP method

POST

Tool inputs (all)

1. message (string) Escalation summary including customer name, email, and why a human is needed

Tool input: message

Input name

message

Input type

string

Input description

Escalation summary including customer name, email, and why a human is needed

Reference value

Use this as the request query or body value and choose “Tool input” in the form.

{{message}}

Request body (all)

chat_id: YOUR_TELEGRAM_CHAT_ID text: {{message}}

Field name

chat_id

Field value

YOUR_TELEGRAM_CHAT_ID

Field name

text

Field value

{{message}}

Headers (all)

Header values are encrypted when stored. Replace placeholders with your real secrets.

Content-Type: application/json

Header name

Content-Type

Header value

application/json