list_chats
Retrieves all known Telegram chats from bot updates and static configuration, providing chat IDs for use with messaging tools. If a chat is missing, returns instructions to add it.
Instructions
List all known chats the bot can send messages to.
Combines two sources:
Persistent discovery: fetches new Telegram updates, extracts chats, and saves them to disk. Subsequent calls return the cached list instantly plus any newly discovered chats.
Static config: chats defined via the KNOWN_CHATS environment variable (format: "Name=chat_id,Name2=chat_id2") are always included.
Returns a dict with:
chats: list of {chat_id, name, type, username, source}
hint: what to tell the user if their desired chat is not in the list
Use the chat_id value with send_message and other tools. If the desired chat is missing, communicate the hint to the user and call list_chats again after they have followed the instructions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||