Skip to main content
Glama

Find chats

find_chats
Read-onlyIdempotent

Search Telegram users, groups, and channels by name, username, phone, or comma-separated usernames; filter results by date, folder, chat type, or public username and return merged chat matches.

Instructions

Find users/groups/channels by name, username, or phone. Comma-separated usernames are searched in parallel and results are merged round-robin. Global search (query required) searches all Telegram; with min_date, max_date, or filter, search uses dialog list or a named filter; include_peers filters use last-activity from GetPeerDialogs; flag-based filters use dialog list dates. Success: dict with key chats (list of chat objects). Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "find_chats"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum chats to return (recommended 50 or less).
queryNoName, username (no @), phone (+country…), or comma-separated usernames for batch lookup. Example: 'alice,bob,charlie'. Required for global search unless you use min_date/max_date or folder alone.
folderNoTelegram folder name (case-insensitive exact match after normalization). In Telegram's UI these are called folders; internally they are "dialog filters" — saved filter presets that group chats by custom criteria (pinned, unread, business, etc.). See Filters-vs-Folders.md for the technical distinction.
publicNoIf true, prefer chats with a public username; if false, without. Does not apply to private DMs. Omit to skip this filter.
max_dateNoInclusive maximum date filter (ISO 8601 date or datetime). Omit for no upper bound.
min_dateNoInclusive minimum date filter (ISO 8601 date or datetime). Omit for no lower bound.
chat_typeNoComma-separated chat kinds: private, bot, group, channel. Case-insensitive; extra spaces allowed.

Output Schema

NameRequiredDescriptionDefault
okNo
codeNo
chatsNo
errorNo
actionNo
paramsNo
exceptionNo
operationNo
error_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.45.0
    • changedInput schema / properties / query / description
      Previous value: -"Name, username (no @), phone (+country…), or comma-separated multi-queries. Required for global search unless you use min_date/max_date or folder alone."New value: +"Name, username (no @), phone (+country…), or comma-separated usernames for batch lookup. Example: 'alice,bob,charlie'. Required for global search unless you use min_date/max_date or folder alone."
  2. Changed3 schema fields changedv0.36.0
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Return type for ``find_chats``."
    • addedOutput schema / properties
      Added value: +{
      +  "action": {
      +    "type": "string"
      +  },
      +  "chats": {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "code": {
      +    "type": "integer"
      +  },
      +  "error": {
      +    "type": "string"
      +  },
      +  "error_code": {
      +    "type": "string"
      +  },
      +  "exception": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "operation": {
      +    "type": "string"
      +  },
      +  "params": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +}
  3. First observedv0.21.0

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the read-only/idempotent annotations, it discloses batch lookup behavior (comma-separated usernames searched in parallel and merged round-robin), global-search requirements, date/filter routing, and the success shape. The stale include_peers mention is a minor transparency defect, but the overall behavioral context is strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the dense sentences mostly carry useful information about modes and return shape. It is slightly run-on and the include_peers reference adds noise, but there is little genuine filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the description covers the main search modes, batch behavior, and success output adequately. An output schema exists, so return-value detail is not required, but the absent include_peers parameter reference leaves a small completeness gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3, but the description adds meaningful semantics for query batching, merging behavior, and the interaction between query, dates, and folder/filter modes. The only issue is that include_peers is described as a filter despite not appearing in the input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: find chats among users/groups/channels by name, username, or phone. It is clear what the tool does, though it does not explicitly distinguish itself from nearby tools like get_chat_info or search_messages_globally.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides useful mode conditions: query is required for global search unless dates or folder are used, and it explains when dialog-list or named-filter behavior applies. However, it never states when to use find_chats versus sibling tools, and it references an include_peers filter that is not present in the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.