Find a Telegram chat
telegram_find_chatFind a person, group or channel by a partial name/title, @username, public Telegram link or numeric chat ID. Use chat_type to filter channels, groups or private chats. With Session, exact @usernames/public links resolve directly through Telegram; partial names search up to 1000 recent account dialogs, case-insensitively. Without Session, search is limited to this account's archive. A post link resolves its chat, not the specific post. After a direct name miss, the server tries bounded Cyrillic/Latin spellings and then distinctive name parts. Inspect match_stage and searched_queries; fallback results are candidates, not confirmed identities. Ask the user to select a candidate before reading personal history or choosing a recipient. Do not guess or transliterate exact @usernames/IDs. This does not join channels or perform global fuzzy search. Clarify ambiguous matches; use a known chat_id directly. If the requested channel cannot be read with the current connection, explain the actual limitation; do not require channel ownership or bot admin rights just for Session reading. Management of a channel you own or administer uses /channels separately. For human display names, extract the name from the request and use its base form (for example, Алексом -> Алекс). After a successful empty name lookup, before following any next_step suggestion to ask for an exact reference, inspect searched_queries across all previous calls and make at most 3 additional telegram_find_chat calls for this person or chat, only with distinct plausible spellings not already searched. Try a common Cyrillic/Latin spelling (for example, Алекс -> Alex when aleks was already searched), then an untried distinctive name part or plausible full/short name. Possible full/short names are candidates, not known aliases of the same person. Keep the requested chat_type and account scope. Stop retrying when candidates appear or the budget is exhausted; confirm the intended chat with the user before reading personal history or sending when it was found by changing the supplied name, even if requires_selection=false or only one candidate is returned. Never guess or alter exact @usernames, numeric IDs or public links. Do not use name retries after tool errors, timeouts or rate limits; respect retry delays. If no plausible untried variant remains, ask for an exact @username, chat ID or more precise name. An empty search alone does not prove disconnection. On no matches, explain only the observed search scope in the user's language; do not invent a cause or say the chat does not exist. After the bounded name retries still miss in Session, explain the 1000-dialog bound and try a known exact @username/public link; otherwise ask for one or a more precise name. For an exact-username miss, ask the user to check the username; do not treat it as a confirmed access denial. For an archive-only name miss, say no matching name was found in the saved archive; do not claim the chat is absent. After exhausting the bounded name retries, ask for an exact reference before suggesting setup. Only if a separate connection check confirms setup is needed, or the user requests another source, offer the relevant setup path, not every option: private conversations use Telegram Chat Automation, selecting @lemma_telepath_bot and the desired chats, then saving; send /setup to https://t.me/lemma_telepath_bot for device-specific steps. For a channel you own or administer, send /channels to that bot, choose Connect my channel and add it as administrator. For a group, an administrator can add @lemma_telepath_bot as a group administrator; the connected user must be a member. Do not request delete, ban or invite permissions just for reading. Bot API saves new messages received after setup; older history needs /import or reads through an already connected Session. Never ask for login codes/passwords in the assistant chat. Do not prescribe reconnection solely for an empty result or require setup for already usable archive content. If the tool errors, distinguish that from zero matches: explain the reported reason and an appropriate next step. Respect a returned retry delay; do not describe a timeout or temporary service failure as lost permissions. If the cause is unknown, say so and suggest retrying or support at https://t.me/hellolemma. Use an already connected Session where supported; preserve source, coverage and actual errors. Do not suggest connecting or reconnecting Session unless the user explicitly asks for Session setup. Never switch sender automatically or request login codes/passwords in chat.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "telegram_find_chat"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many candidates to return. Default 20; Session returns at most 50, archive search at most 100. | |
| query | Yes | Name/title only, using the base form of a person name rather than the full user sentence; or an unchanged exact @username, public t.me link, or numeric chat id. | |
| chat_type | No | Filter by chat type. group includes basic groups and supergroups; channel means broadcast channels. |