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
- In Telegram, message @BotFather, create a bot, and copy the bot token.
- 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).
- Replace YOUR_BOT_TOKEN in the Endpoint URL and YOUR_TELEGRAM_CHAT_ID in the request body.
- 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
Description
Endpoint URL
Paste into Endpoint URL (https:// is added automatically).
HTTP method
Tool inputs (all)
Tool input: message
Input name
Input type
Input description
Reference value
Use this as the request query or body value and choose “Tool input” in the form.
Request body (all)
Field name
Field value
Field name
Field value
Headers (all)
Header values are encrypted when stored. Replace placeholders with your real secrets.
Header name
Header value
